/** * One validated `x-mcp-header` annotation: which header to write, which * argument to read it from, and how to spell that argument. * * `path` is the exact chain of `properties` keys leading to the annotated * property, which is also the path into a call's `arguments` object. It is * produced only by {@link validateMcpHeaderAnnotations}, so a binding cannot * exist for a property that was not statically reachable. */ export interface McpParamHeaderBinding { /** The full field name, prefix included — `Mcp-Param-Region`. */ readonly header: string; /** The chain of `properties` keys, read against the call's `arguments`. */ readonly path: readonly string[]; readonly type: 'string' | 'boolean' | 'integer'; } /** * Whether a tool definition may be exposed, and what it asked to mirror. * * A verdict about the WHOLE tool, not about one annotation: the spec makes a * single bad annotation invalidate the tool definition, because a client * that mirrored the rest would send a request the server then rejects for * headers it cannot explain. */ export type McpHeaderAnnotationVerdict = { readonly ok: true; readonly bindings: readonly McpParamHeaderBinding[]; } | { readonly ok: false; readonly reason: string; }; /** * Decide whether a tool may be exposed, and collect what it asked to mirror. * * The six constraints, in the spec's own order: non-empty; HTTP field-name * token syntax; no control characters; case-insensitively unique across the * whole `inputSchema`; applied only to `string`, `boolean` or `integer` * (never `number`); and statically reachable through a chain of `properties` * keys alone. * * Returns a REASON rather than throwing, because the caller's job is to drop * one tool and keep the rest: a listing where one definition is malformed * must still deliver the others, and an exception here would take the whole * listing down with it. */ export declare function validateMcpHeaderAnnotations(inputSchema: unknown): McpHeaderAnnotationVerdict; /** * The `Mcp-Param-*` field values for one call's arguments, unencoded. * * Returns the values as the BODY carries them; wrapping a value that cannot * be written into a header field verbatim is the envelope's job, so the * sentinel rule lives in one place for `Mcp-Name` and `Mcp-Param-*` alike * rather than being reimplemented here. */ export declare function mcpParamHeaderValues(bindings: readonly McpParamHeaderBinding[], args: unknown): Record; //# sourceMappingURL=x-mcp-header.d.ts.map