Skip to main content
Glama

Zendesk API MCP Server

get_organization

Retrieve organization details from Zendesk API using a unique organization ID for efficient customer support management.

Input Schema

NameRequiredDescriptionDefault
idYesOrganization ID

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "id": { "description": "Organization ID", "type": "number" } }, "required": [ "id" ], "type": "object" }

Implementation Reference

  • The main handler function for the 'get_organization' tool. It calls zendeskClient.getOrganization(id), formats the result as JSON text content, or returns an error response.
    handler: async ({ id }) => { try { const result = await zendeskClient.getOrganization(id); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error getting organization: ${error.message}` }], isError: true }; } } },
  • Input schema using Zod for validating the 'id' parameter as a number.
    schema: { id: z.number().describe("Organization ID") },
  • The tool definition object including name, description, schema, and handler, which is exported as part of organizationsTools and later registered in server.js.
    { name: "get_organization", description: "Get a specific organization by ID", schema: { id: z.number().describe("Organization ID") }, handler: async ({ id }) => { try { const result = await zendeskClient.getOrganization(id); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error getting organization: ${error.message}` }], isError: true }; } } },
  • src/server.js:48-52 (registration)
    Registration loop in the MCP server that registers the 'get_organization' tool (included via organizationsTools spread) by calling server.tool().
    allTools.forEach((tool) => { server.tool(tool.name, tool.schema, tool.handler, { description: tool.description, }); });
  • ZendeskClient helper method that makes the API request to fetch a specific organization by ID, called by the tool handler.
    async getOrganization(id) { return this.request("GET", `/organizations/${id}.json`); }

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/JurreBrandsenInfoSupport/zendesk-mcp'

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