Skip to main content
Glama
XeroAPI

Xero MCP Server

Official

create-tracking-category

Add a new tracking category in Xero to organize and monitor transactions by custom criteria like departments, projects, or locations.

Instructions

Create a tracking category in Xero.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes

Implementation Reference

  • MCP tool handler: processes the input name, calls createXeroTrackingCategory, handles error/success, and returns formatted text response.
    async ({ name }) => {
      const response = await createXeroTrackingCategory(name);
    
      if (response.isError) {
        return {
          content: [
            {
              type: "text" as const,
              text: `Error while creating tracking category: ${response.error}`
            }
          ]
        };
      }
    
      const trackingCategory = response.result;
      
      return {
        content: [
          {
            type: "text" as const,
            text: `Created the tracking category "${trackingCategory.name}" (${trackingCategory.trackingCategoryID}).`
          },
        ]
      };
    }
  • Zod input schema defining the required 'name' string parameter for the tool.
    {
      name: z.string()
    },
  • Local registration: adds CreateTrackingCategoryTool to the CreateTools array (imported on line 10).
    export const CreateTools = [
      CreateContactTool,
      CreateCreditNoteTool,
      CreateManualJournalTool,
      CreateInvoiceTool,
      CreateQuoteTool,
      CreatePaymentTool,
      CreateItemTool,
      CreateBankTransactionTool,
      CreatePayrollTimesheetTool,
      CreateTrackingCategoryTool,
      CreateTrackingOptionsTool
    ];
  • Global registration: registers all tools from CreateTools (including create-tracking-category) to the MCP server.
    CreateTools.map((tool) => tool()).forEach((tool) =>
      server.tool(tool.name, tool.description, tool.schema, tool.handler),
    );
  • Supporting handler: authenticates Xero client, creates tracking category via API, returns structured result or error.
    export async function createXeroTrackingCategory(
      name: string
    ): Promise<XeroClientResponse<TrackingCategory>> {
      try {
        const createdTrackingCategory = await createTrackingCategory(name);
    
        if (!createdTrackingCategory) {
          throw new Error("Tracking Category creation failed.");
        }
    
        return {
          result: createdTrackingCategory,
          isError: false,
          error: null
        };
      } catch (error) {
        return {
          result: null,
          isError: true,
          error: formatError(error)
        };
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool creates a tracking category, implying a write operation, but does not cover aspects like required permissions, whether the operation is idempotent, rate limits, or what happens on success/failure. This leaves significant gaps for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words, making it easy to parse. It is appropriately sized for the tool's apparent simplicity, though it could benefit from additional context.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with no annotations, no output schema, and a parameter with 0% schema coverage, the description is incomplete. It does not explain the return value, error conditions, or behavioral nuances, leaving the agent with insufficient information to use the tool effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description does not mention the 'name' parameter at all, and with 0% schema description coverage, the parameter is undocumented in both the schema and description. However, since there is only one parameter, the baseline is 4, but the lack of any parameter information in the description reduces it to 3, as it fails to compensate for the schema gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('create') and resource ('tracking category in Xero'), making the purpose unambiguous. However, it does not differentiate from sibling tools like 'create-tracking-options' or 'update-tracking-category', which are related but distinct operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'update-tracking-category' or 'list-tracking-categories', nor does it mention prerequisites such as authentication or permissions. The description lacks context for distinguishing it from similar tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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

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