MCP · MCP0016
Declare an inputSchema for MCP tools that read arguments
Report h3-mcp and nitro-mcp-toolkit tools without an `inputSchema` whose handler destructures arguments from its first parameter.
mcp/tools/no-args-without-input-schemasrc/rule-packs/mcp/rules/no-args-without-input-schema.ts Upstream docs Run this rule
pnpm vite-doctor . --rules mcp/tools/no-args-without-input-schema
Why it matters
Without an inputSchema, h3-mcp (okmcp) and nitro-mcp-toolkit call handler(event), not handler(args, event). A handler written as ({ id }) => then reads event.id, which is always undefined, and the tool also advertises that it takes no arguments, so clients never send any.
Recommended fix
Declare an inputSchema that describes the arguments the handler reads.
Useful links
Example
Declare the arguments
Before
defineTool({
name: 'get_order',
handler: async ({ id }) => orderResult(await findOrder(id)),
})
After
defineTool({
name: 'get_order',
inputSchema: z.object({ id: z.string() }),
handler: async ({ id }) => orderResult(await findOrder(id)),
})