Skip to main content
Glama

Twenty CRM MCP Server

by denisalmeida
tools.js1.93 kB
import { getAllTools, getToolByName } from '../tools/index.js'; import { logger } from '../utils/logger.js'; export function setupToolsRoutes(app) { // GET /tools - List all tools (summary only for performance) app.get("/tools", async (req, res) => { try { const tools = getAllTools(); // Return lightweight summary const summary = tools.map(tool => ({ name: tool.name, description: tool.description })); res.json({ success: true, tools: summary, totalCount: tools.length }); } catch (error) { logger.error(`List tools error:`, error.message); res.status(500).json({ success: false, error: error.message }); } }); // GET /tools/:toolName - Get specific tool details app.get("/tools/:toolName", async (req, res) => { try { const { toolName } = req.params; const tool = getToolByName(toolName); if (!tool) { return res.status(404).json({ success: false, error: `Tool '${toolName}' not found` }); } res.json({ success: true, tool }); } catch (error) { logger.error(`Get tool error:`, error.message); res.status(500).json({ success: false, error: error.message }); } }); // GET /tools/:toolName/schema - Get only the schema app.get("/tools/:toolName/schema", async (req, res) => { try { const { toolName } = req.params; const tool = getToolByName(toolName); if (!tool) { return res.status(404).json({ success: false, error: `Tool '${toolName}' not found` }); } res.json({ success: true, schema: tool.inputSchema }); } catch (error) { logger.error(`Get tool schema error:`, error.message); res.status(500).json({ success: false, error: error.message }); } }); }

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/denisalmeida/twenty-crm-mcp'

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