We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/gergelyszerovay/mcp-id-date'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
McpTool.ts•1.54 KiB
import type { TextContent } from '@modelcontextprotocol/sdk/types.js';
import type { JsonContent } from './JsonContent';
import type { McpToolError } from './McpToolError';
export type McpToolHandlerParams = {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
params: any;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
appState: any;
};
export type MCpToolHandlerFunction = (param: McpToolHandlerParams) => Promise<(TextContent | JsonContent<unknown>)[] | McpToolError>;
/**
* Configuration for an MCP tool. Defines the interface and behavior of a tool that can be used
* in the MCP (Machine Conversation Protocol) system.
*/
export type McpTool = {
/** Unique name identifying the tool */
name: string;
/** Description of what the tool does */
description: string;
/** Schema for validating tool input (undefined === empty input) */
inputSchema?: unknown;
/** Name of the input schema type */
inputSchemaName: string;
/** Types of output this tool can produce */
outputTypes: ('text' | 'json' | 'image')[];
/** Schema for validating JSON output (only required when "json" is in outputTypes) */
jsonOutputSchema?: unknown;
/** Name of the JSON output schema type (only required when "json" is in outputTypes) */
jsonOutputSchemaName?: string;
/** Function that implements the tool's logic. This function will be called when the tool is invoked. */
handler: MCpToolHandlerFunction;
/** Specifies which operational modes this tool is available in */
enabledInModes: ('rest' | 'mcpAct' | 'mcpPlan')[];
};