UNPKG

run402-mcp

Version:

MCP server for Run402 — full-stack backend infrastructure for AI agents: Postgres, auth, storage, serverless functions and atomic deploys. Paid with x402/MPP. Includes $0.03 image generation.

26 lines • 1.49 kB
/** * Tool arguments are strict: an argument a tool does not declare is refused, * never silently dropped. * * Every tool is registered with its strict schema (`strictInput`), so the * published JSON Schema says `additionalProperties: false`, and the server * (`mcp-server.ts`) checks each `tools/call` against the same schema before * the handler runs, answering a failure with the structured error: * `UNKNOWN_ARGUMENT` (with the closest declared names) or `INVALID_ARGUMENTS`. */ import { type ObjectSchema, type RawShape } from "./schema.js"; import type { ToolError } from "./structured.js"; /** A tool's input shape as a strict object: unknown keys fail. */ export declare function strictInput<T extends RawShape>(shape: T): ObjectSchema<T, "strict">; /** A tool's strict input schema, whatever its shape (`any`: `refine` makes schemas invariant). */ export type StrictSchema = ObjectSchema<any, "strict">; /** * The structured refusal for arguments that fail a tool's strict schema, or null when they pass. * * An undeclared key is named by its dotted path from the arguments, so a key * nested inside an argument (`functions.patch.set.api.klass`) is never * reported as a top-level argument; its `did_you_mean` searches the keys the * object holding it declares, and `accepted_at` lists them by that object's path. */ export declare function argumentError(tool: string, schema: StrictSchema, args: unknown): ToolError | null; //# sourceMappingURL=input-guard.d.ts.map