Skip to main content
Glama
numbers.ts1.21 kB
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { createToolHandler, getAuthToken } from "../utils.js"; import { JustCallApiService } from "../../sdk/justcall.js"; import { ListNumbersSchema, GetNumberSchema } from "../../schema/index.js"; export const registerNumberTools = (server: McpServer) => { const justcallAPIservice = new JustCallApiService(); // List Numbers Tool server.tool( "list_numbers", "Retrieve all phone numbers associated with the JustCall account", ListNumbersSchema, { readOnlyHint: true, }, createToolHandler(async (params, context) => { const authToken = getAuthToken(context); return justcallAPIservice.listNumbers({ authToken, context, ...params, }); }), ); // Get Number Tool server.tool( "get_number", "Retrieve detailed information for a specific phone number by ID", GetNumberSchema, { readOnlyHint: true, }, createToolHandler(async (params, context) => { const authToken = getAuthToken(context); return justcallAPIservice.getNumber({ authToken, context, ...params, }); }), ); };

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/saaslabsco/justcall-mcp-server'

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