get_organization
Retrieve organization details from Zendesk using the organization ID to access customer information and manage support relationships.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Organization ID |
Implementation Reference
- src/tools/organizations.js:36-51 (handler)The MCP tool handler for 'get_organization'. It takes an organization ID, fetches the organization via zendeskClient, and returns formatted JSON or error message.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/tools/organizations.js:33-35 (schema)Input schema using Zod for validating the 'id' parameter as a number.schema: { id: z.number().describe("Organization ID") },
- src/server.js:48-52 (registration)Registers all tools, including 'get_organization' from organizationsTools, with the MCP server via server.tool(). organizationsTools imported at line 11 and spread into allTools at line 34.allTools.forEach((tool) => { server.tool(tool.name, tool.schema, tool.handler, { description: tool.description, }); });
- src/zendesk-client.js:126-128 (helper)ZendeskClient helper method that performs the actual API GET request to retrieve the organization by ID.async getOrganization(id) { return this.request("GET", `/organizations/${id}.json`); }