Skip to main content
Glama

IT Tools MCP Server

index.ts•1.36 kB
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { z } from "zod"; export function registerEvaluateMath(server: McpServer) { server.registerTool("evaluate_math", { description: "Safely evaluate mathematical expressions", inputSchema: { expression: z.string().describe("Mathematical expression to evaluate (e.g., '2 + 3 * 4')") }, // VS Code compliance annotations annotations: { title: "Evaluate Math", description: "Safely evaluate mathematical expressions", readOnlyHint: false } }, async ({ expression }) => { try { // @ts-ignore: Ignore missing type declarations for mathjs const { compile } = await import("mathjs"); const start = Date.now(); const code = compile(expression); const result = code.evaluate(); const elapsed = Date.now() - start; return { content: [ { type: "text", text: `Expression: ${expression}\nResult: ${result}\n(evaluated in ${elapsed} ms)` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error evaluating expression: ${error instanceof Error ? error.message : 'Unknown error'}` } ] }; } } ); }

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/wrenchpilot/it-tools-mcp'

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