MCP · Tools

MCP0016Declare 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.

Why it happens

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.

Fix

Declare an inputSchema that describes the arguments the handler reads.

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)),
})

Verify the fix

Run only this rule after editing so the report stays focused on the diagnostic you are closing:

pnpm vite-doctor . --rules mcp/tools/no-args-without-input-schema
Copyright © 2026