import { Icon, ToolCallContext, ToolDefinition } from "./index.mjs"; import { CallToolResult, Tool, ToolAnnotations } from "@modelcontextprotocol/server"; export interface McpServerInfo { /** Server name, also used in the unknown-tool message. */ readonly name: string; readonly version: string; /** Display name for clients that show one, such as `Forges`. */ readonly title?: string; /** One line under the name on a connector card or in a registry. */ readonly description?: string; readonly icons?: readonly Icon[]; /** Project home a client can link to. */ readonly websiteUrl?: string; } /** What a tool finds in `host` over MCP. The client wrote all of it, so none of it is proof. */ export interface McpHost { readonly mcp: true; /** The HTTP request behind the call, headers included. Absent over stdio. */ readonly request?: Request; /** The call's `_meta` as the transport hands it over, such as a harness's session id. */ readonly meta?: Readonly>; } /** * Maps a tool's title and declared effect to MCP annotations. Claude Code reads its label here. * A process the tool starts can delete anything, so `exec` counts as destructive. * * @param tool - Tool to describe. * @returns {ToolAnnotations} Title and hints for the MCP client. */ export declare function toolAnnotations(tool: ToolDefinition): ToolAnnotations; /** * Error result with every line-forging character replaced. * * The messages echo client-controlled values (a tool name, an argument) and * downstream error text, so they pass through here on every branch. Each line * is cleaned on its own, so only the breaks between the lines passed in * survive; a newline inside one line becomes a space. * * @param lines - Error lines. * @returns {CallToolResult} MCP error result. */ export declare function errorResult(...lines: readonly string[]): CallToolResult; /** * The entries `tools/list` answers with, in the order given. * * @param tools - Tools to list. * @returns {Tool[]} Name, title, description, icons, schemas, annotations and `_meta` of each tool. * @throws {ToolDefinitionError} When two tools share a name. */ export declare function listTools(tools: readonly ToolDefinition[]): Tool[]; /** * Answers one call as `tools/call` does and never throws, so every transport gives the same text. * * @param info - Server info; `name` is the word in the message for an unknown tool. * @param tools - Tools to look the name up in. * @param name - Tool name as the client sent it. * @param args - Arguments as the client sent them; missing ones count as `{}`. * @param context - Context for this call, such as the request's abort signal. * @returns {Promise} The tool's text, or the sanitized error. */ export declare function callTool(info: Pick, tools: readonly ToolDefinition[], name: string, args?: unknown, context?: ToolCallContext): Promise;