McpToolHeaders
Namespace: Vercel.AI.Mcp
public static class McpToolHeadersReads x-mcp-header annotations and encodes Mcp-Param-* headers.
Inheritance: object
Methods
Section titled “Methods”CreateHeaders(IReadOnlyList<Binding>, JsonElement)
Section titled “CreateHeaders(IReadOnlyList<Binding>, JsonElement)”public static IReadOnlyDictionary<string, string> CreateHeaders(IReadOnlyList<McpToolHeaders.Binding> bindings, JsonElement arguments)Builds Mcp-Param-* headers from tool arguments.
Parameters
| Name | Type | Description |
|---|---|---|
bindings |
IReadOnlyList<McpToolHeaders.Binding> | |
arguments |
JsonElement |
Returns: IReadOnlyDictionary<string, string>
EncodeValue(string)
Section titled “EncodeValue(string)”public static string EncodeValue(string value)Encodes a header value, using the base64 sentinel when the text is not plain ASCII.
Parameters
| Name | Type | Description |
|---|---|---|
value |
string |
Returns: string
GetBindings(JsonElement)
Section titled “GetBindings(JsonElement)”public static McpToolHeaders.BindingResult GetBindings(JsonElement inputSchema)Collects statically reachable x-mcp-header annotations.
Parameters
| Name | Type | Description |
|---|---|---|
inputSchema |
JsonElement |
Returns: McpToolHeaders.BindingResult
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product