Skip to main content
Glama
apify

actors-mcp-server

Official
by apify
proxy.ts1.13 kB
import type { Client } from '@modelcontextprotocol/sdk/client/index.js'; import { fixedAjvCompile } from '../tools/utils.js'; import type { ActorMcpTool, ToolEntry } from '../types.js'; import { ajv } from '../utils/ajv.js'; import { getMCPServerID, getProxyMCPServerToolName } from './utils.js'; export async function getMCPServerTools( actorID: string, client: Client, // Name of the MCP server serverUrl: string, ): Promise<ToolEntry[]> { const res = await client.listTools(); const { tools } = res; const compiledTools: ToolEntry[] = []; for (const tool of tools) { const mcpTool: ActorMcpTool = { type: 'actor-mcp', actorId: actorID, serverId: getMCPServerID(serverUrl), serverUrl, originToolName: tool.name, name: getProxyMCPServerToolName(serverUrl, tool.name), description: tool.description || '', inputSchema: tool.inputSchema, ajvValidate: fixedAjvCompile(ajv, tool.inputSchema), }; compiledTools.push(mcpTool); } return compiledTools; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/apify/actors-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server