Skip to main content
Glama
tool-mode.ts1.24 kB
/** * Determines which MCP tool set should be exposed to clients. * * By default we expose the complete universal tool catalogue. Setting * `ATTIO_MCP_TOOL_MODE=search` limits the surface area to the lightweight * search/fetch compatibility tools that match OpenAI's baseline MCP support. */ const SEARCH_ONLY_ENV_VALUE = 'search'; const SEARCH_ONLY_TOOL_NAMES = new Set(['search', 'fetch', 'aaa-health-check']); /** * Returns true when the server should run in search-only compatibility mode. */ export function isSearchOnlyMode(): boolean { const mode = (process.env.ATTIO_MCP_TOOL_MODE ?? '').toLowerCase(); return mode === SEARCH_ONLY_ENV_VALUE; } /** * Determines whether a given tool name may be exposed in the current mode. */ export function isToolAllowed(toolName: string): boolean { if (!isSearchOnlyMode()) { return true; } return SEARCH_ONLY_TOOL_NAMES.has(toolName); } /** * Filters an array of tool definitions/configurations so only the allowed * tools are returned for the active server mode. */ export function filterAllowedTools<T extends { name: string }>( tools: T[] ): T[] { if (!isSearchOnlyMode()) { return tools; } return tools.filter((tool) => isToolAllowed(tool.name)); }

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/kesslerio/attio-mcp-server'

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