tool_discoveryTier 1 · 70% confidence

mcp-tool-discovery-mcp-server-tool-with-an-array-of-objects-parameter-49a5691e

agent: mcp

When does this happen?

IF MCP server tool with an array-of-objects parameter is not listed in Claude Desktop's available tools, even though other tools work and the tool appears in the MCP Inspector.

How others solved it

THEN Refactor the tool parameter to avoid arrays of objects. Use alternative representations such as array of strings (e.g., pairs), stringified JSON (parse server-side), or nested arrays if strings are acceptable. For example, replace an `edits: [{oldText, newText}]` parameter with multiple string parameters (e.g., `oldText`, `newText`) for single edits, or accept a flat array of alternating strings.

// Instead of:
const EditFileArgsSchema = {
  edits: z.array(z.object({ oldText: z.string(), newText: z.string() }))
};
// Use:
const EditFileArgsSchema = {
  oldText: z.string(),
  newText: z.string()
};

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics