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.
MCP0016vite-doctor/mcptoolserrorSuggestion

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.

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)),
})
Copyright © 2026