Skip to content

Conversation

@pfernandom
Copy link

@pfernandom pfernandom commented Oct 27, 2025

Currently, tool definitions retrieved from an MCP server using GentkitMCPClient method GetActiveTools contain only an empty map at tool.Definition().OutputSchema, even if the server explicitly declares an output schema for the given tool.

e.g. For the following MCP response:

{
  "tools": [
    {
      "name": "embed",
      "description": "Embed a text into a vector",
      "inputSchema": {
        "properties": { "text": { "type": "string" } },
        "required": ["text"],
        "type": "object"
      },
      "outputSchema": {
        "properties": {
          "result": { "items": { "type": "number" }, "type": "array" }
        },
        "required": ["result"],
        "type": "object",
        "x-fastmcp-wrap-result": true
      },
      "_meta": { "_fastmcp": { "tags": [] } }
    }
  ]
}

The following data is included in the tool definition:
Screenshot 2025-10-27 at 2 16 19 PM

This is in part because the current version for github.com/mark3labs/mcp-go doesn't include the OutputSchema attribute in the struct used to deserialize the message:

Screenshot 2025-10-27 at 2 19 51 PM

This PR introduces the following changes:

  • Update github.com/mark3labs/mcp-go to the latest version, which does include OutputSchema in the Tool struct.
  • Update the genkit MCP functions to actually retrieve the schema and use it during tool retrieval.

Checklist (if applicable):

@google-cla
Copy link

google-cla bot commented Oct 27, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions github-actions bot added the go label Oct 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant