Skip to content

Migrate HTTP API calls to libre-graph-api-go SDK #13

Description

@kobergj

Context

Currently the MCP server hand-rolls all LibreGraph API calls using internal
client.GetJSON/client.ListJSON/client.PostJSON helpers with hardcoded
path strings (e.g. fmt.Sprintf("/graph/v1beta1/drives/%s/items/%s/invite", ...)).

This was flagged in #11 by @DeepDiver1975 — the ownCloud org already maintains
a generated Go SDK at https://github.com/owncloud/libre-graph-api-go that covers
the full API surface.

Problem

Hand-rolling paths leads to subtle bugs (wrong API version prefix, wrong response
envelope format, etc.) that are hard to catch without a live instance. PR #11 is
a direct result of this — several endpoints were broken because v1.0 was used
instead of v1beta1.

Proposed Solution

Replace the internal HTTP helpers with the libre-graph-api-go SDK:

  • Proper Go types for all requests/responses
  • API paths and version prefixes maintained by the SDK
  • Future API changes are picked up via dependency update

Acceptance Criteria

  • libre-graph-api-go added as a dependency
  • All tools in shares.go, spaces.go, workflows.go, resources.go
    use SDK clients instead of raw HTTP helpers
  • Internal client.ListJSON/client.GetJSON/client.PostJSON helpers
    removed or scoped to endpoints not covered by the SDK
  • All existing tests pass

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions