create_organization
Create a new organization in Zendesk by specifying its name, domain names, details, notes, and tags. Facilitates efficient management of organizational data within the Zendesk API MCP Server.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| details | No | Details about the organization | |
| domain_names | No | Domain names for the organization | |
| name | Yes | Organization name | |
| notes | No | Notes about the organization | |
| tags | No | Tags for the organization |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"details": {
"description": "Details about the organization",
"type": "string"
},
"domain_names": {
"description": "Domain names for the organization",
"items": {
"type": "string"
},
"type": "array"
},
"name": {
"description": "Organization name",
"type": "string"
},
"notes": {
"description": "Notes about the organization",
"type": "string"
},
"tags": {
"description": "Tags for the organization",
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"name"
],
"type": "object"
}
Implementation Reference
- src/tools/organizations.js:63-85 (handler)The handler function that executes the create_organization tool logic. It constructs the organization data from inputs and calls the Zendesk client to create it, handling success and error responses.handler: async ({ name, domain_names, details, notes, tags }) => { try { const orgData = { name, domain_names, details, notes, tags }; const result = await zendeskClient.createOrganization(orgData); return { content: [{ type: "text", text: `Organization created successfully!\n\n${JSON.stringify(result, null, 2)}` }] }; } catch (error) { return { content: [{ type: "text", text: `Error creating organization: ${error.message}` }], isError: true }; }
- src/tools/organizations.js:56-62 (schema)Zod schema defining the input parameters for the create_organization tool.schema: { name: z.string().describe("Organization name"), domain_names: z.array(z.string()).optional().describe("Domain names for the organization"), details: z.string().optional().describe("Details about the organization"), notes: z.string().optional().describe("Notes about the organization"), tags: z.array(z.string()).optional().describe("Tags for the organization") },
- src/tools/organizations.js:53-86 (registration)The complete tool definition object for 'create_organization' within the organizationsTools array, which is exported and later imported and registered in src/server.js.{ name: "create_organization", description: "Create a new organization", schema: { name: z.string().describe("Organization name"), domain_names: z.array(z.string()).optional().describe("Domain names for the organization"), details: z.string().optional().describe("Details about the organization"), notes: z.string().optional().describe("Notes about the organization"), tags: z.array(z.string()).optional().describe("Tags for the organization") }, handler: async ({ name, domain_names, details, notes, tags }) => { try { const orgData = { name, domain_names, details, notes, tags }; const result = await zendeskClient.createOrganization(orgData); return { content: [{ type: "text", text: `Organization created successfully!\n\n${JSON.stringify(result, null, 2)}` }] }; } catch (error) { return { content: [{ type: "text", text: `Error creating organization: ${error.message}` }], isError: true }; } }
- src/zendesk-client.js:130-132 (helper)Supporting Zendesk client method that makes the POST API request to create an organization.async createOrganization(data) { return this.request("POST", "/organizations.json", { organization: data }); }
- src/server.js:48-52 (registration)Generic registration loop that registers all tools, including create_organization, with the MCP server.allTools.forEach((tool) => { server.tool(tool.name, tool.schema, tool.handler, { description: tool.description, }); });