Skip to main content
Glama
get-contact-details.ts834 B
import { type Tool } from 'fastmcp'; import { z } from 'zod'; import { get } from '../../utils/requests.js'; import { contactDetailsSchema } from '../../schemas/contacts.js'; import { throwApiInvalidResponseError } from '../../utils/errors.js'; const parameters = z.object({ contact_id: z.string(), }); export const getContactDetailsTool: Tool<typeof parameters._type, typeof parameters> = { name: 'get_contact_details', description: 'Get all details for a contact by id', parameters, annotations: { title: 'Get Contact Details', openWorldHint: true, }, async execute({ contact_id }) { const result = await get(`/contacts/${contact_id}`); const parsed = contactDetailsSchema.safeParse(result); if (!parsed.success) { throwApiInvalidResponseError(parsed.error); } return JSON.stringify(parsed.data); }, };

Implementation Reference

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

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