Skip to content

Fetching resources is not implemented #206

@sjoelund

Description

@sjoelund

For the example server, the following code is used:

Resource metrics_resource;
metrics_resource.uri = "metrics://server/stats";
metrics_resource.name = "Server Metrics";
metrics_resource.description = mcp::make_optional(std::string("Server performance metrics and statistics"));
metrics_resource.mimeType = mcp::make_optional(std::string("application/json"));
server.registerResource(metrics_resource);

Calling

{
    "method": "resources/read",
    "params": {
        "uri": "metrics://server/stats",
        "_meta": {
            "progressToken": 4
        }
    },
    "jsonrpc": "2.0",
    "id": 4
}

Results in:

{
    "id": 4,
    "jsonrpc": "2.0",
    "result": {
        "contentCount": 1,
        "uri": "metrics://server/stats"
    }
}

Which has 2 problems:

  1. the result of a resource read is an array and the contents of the object different according to the schema
  2. There is nowhere to plug in how to perform responses to resource read requests, so it would only work for http (which is handled by the client).

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