-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtypes.ts
More file actions
28 lines (25 loc) · 1.06 KB
/
types.ts
File metadata and controls
28 lines (25 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
export type { AuthInfo } from "@modelcontextprotocol/sdk/server/auth/types.js";
import type { CallToolResult, ListToolsResult } from "@modelcontextprotocol/sdk/types.js";
import type { AuthInfo } from "@modelcontextprotocol/sdk/server/auth/types.js";
export interface BuildInfo {
name: string;
version: string;
gitCommit?: string | undefined;
buildDate?: string | undefined;
}
export interface ToolCallContext {
/** Validated auth info from transport middleware (HTTP only). */
authInfo?: AuthInfo;
/** HTTP request headers (HTTP transport only). */
headers?: Record<string, string | string[] | undefined>;
/** Client name/version from MCP init handshake. Best-effort and may be absent in stateless/degraded handling. */
clientInfo?: { name: string; version: string };
/** Abort signal for request cancellation. */
signal: AbortSignal;
}
export interface CustomTool {
name: string;
description: string;
inputSchema: ListToolsResult["tools"][number]["inputSchema"];
handler: (args: unknown, context: ToolCallContext) => Promise<CallToolResult>;
}