Skip to content

Regression in 1.11.1: not assigning tool arguments in schema #467

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kirk-marple opened this issue May 8, 2025 · 4 comments
Closed

Regression in 1.11.1: not assigning tool arguments in schema #467

kirk-marple opened this issue May 8, 2025 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@kirk-marple
Copy link

When defining a tool in 1.11.1, the tool arguments don't appear on the MCP client.

However, using 1.10.2, they do.

Something must have broken between these two versions.

    server.tool(
    "searchMcpServers",
    `Retrieve relevant MCP Servers and Tools from McPoogle search engine. Use this tool to find MCP Servers and Tools that match a given user prompt. The search results will include the name, description, and GitHub URL of each MCP Server.
    Accepts an LLM user prompt for content retrieval. For best retrieval quality, provide only key words or phrases from the user prompt, which will be used to create text embeddings for a vector search query.
    Returns the ranked content sources, including their content resource URI to retrieve the complete Markdown text.`,
    { 
        prompt: z.string().describe("LLM user prompt for MCP search.")
    },
    async ({ prompt }) => {
[removed]
    }
    );   

For more detail, see issue in Vercel MCP adapter repo.

vercel-labs/mcp-for-next.js#9

@axel-rock
Copy link

axel-rock commented May 9, 2025

Someone from Vercel pointed me to this issue, it appears that I have the same issue. Using 1.10.2 brings back the arguments.

If that helps, I have a basic reproduction using SvelteKit's boilerplate here: https://github.com/axel-rock/sveltekit-mcp

@bohdan-romanchenko
Copy link

This fragment is returning false once argument where passed via @vercel/mcp-adapter server.tool function.

const isZodRawShape = (obj: unknown): obj is ZodRawShape => {
  if (typeof obj !== "object" || obj === null) return false;

  const isEmptyObject = z.object({}).strict().safeParse(obj).success;

  // Check if object is empty or at least one property is a ZodType instance
  return isEmptyObject || Object.values(obj as object).some(v => v instanceof ZodType);
};

Particularly this part is returning false: Object.values(obj as object).some(v => v instanceof ZodType).

The argument could be like this:

const t = server.tool(
  "echo",
  "Echo a message",
  { message: z.string() },
  async ({ message }) => ({
    content: [{ type: "text", text: `Tool echo: ${message}` }],
  })
);

Once I try the same isZodRawShape in the same server execution or in tests - it works correctly, but the integration part is failing in some moment.

@bohdan-romanchenko
Copy link

Seems to be resolved here #468

@axel-rock
Copy link

I confirm that it works with 1.11.2 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants