xero_navigate
Browse available Xero tools organized by domain. Select a domain to see tool names and descriptions for managing contacts, invoices, payments, accounts, or reports.
Instructions
Discover available Xero tools by domain. Returns tool names and descriptions for the selected domain. All tools are callable at any time — this is a help/discovery aid, not a prerequisite.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domain | Yes | The domain to explore: - contacts: Contact management - list, get, create, and search contacts (customers and suppliers) - invoices: Invoice management - list, get, create invoices and update their status - payments: Payment management - list, get, and create payments against invoices - accounts: Chart of accounts - list and view account details by type and class - reports: Financial reports - profit & loss, balance sheet, aged receivables, and aged payables |
Implementation Reference
- src/index.ts:120-146 (schema)Tool definition and input schema for the xero_navigate tool, including the domain enum and description.
const navigateTool: Tool = { name: "xero_navigate", description: "Discover available Xero tools by domain. Returns tool names and descriptions for the selected domain. All tools are callable at any time — this is a help/discovery aid, not a prerequisite.", inputSchema: { type: "object", properties: { domain: { type: "string", enum: [ "contacts", "invoices", "payments", "accounts", "reports", ], description: `The domain to explore: - contacts: ${domainDescriptions.contacts} - invoices: ${domainDescriptions.invoices} - payments: ${domainDescriptions.payments} - accounts: ${domainDescriptions.accounts} - reports: ${domainDescriptions.reports}`, }, }, required: ["domain"], }, }; - src/index.ts:208-224 (handler)Handler for xero_navigate tool calls. Extracts the domain argument, looks up the tools for that domain via getDomainTools(), and returns a formatted text response listing available tools.
if (name === "xero_navigate") { const { domain } = args as { domain: Domain }; const domainTools = getDomainTools(domain); const toolSummary = domainTools .map((t) => `- ${t.name}: ${t.description}`) .join("\n"); return { content: [ { type: "text", text: `${domainDescriptions[domain]}\n\nAvailable tools:\n${toolSummary}\n\nYou can call any of these tools directly.`, }, ], }; } - src/index.ts:195-198 (registration)Registration of xero_navigate in the ListTools handler. The navigateTool is included in the full list of tools returned by the server.
server.setRequestHandler(ListToolsRequestSchema, async () => { const domainTools = getAllDomainTools(); return { tools: [navigateTool, statusTool, backTool, ...domainTools] }; }); - src/index.ts:73-86 (helper)Helper function used by the xero_navigate handler to retrieve domain-specific tools by domain name.
function getDomainTools(domain: Domain): Tool[] { switch (domain) { case "contacts": return contactTools; case "invoices": return invoiceTools; case "payments": return paymentTools; case "accounts": return accountTools; case "reports": return reportTools; } } - src/index.ts:57-68 (helper)Domain descriptions used by the xero_navigate handler to describe each domain in its response.
const domainDescriptions: Record<Domain, string> = { contacts: "Contact management - list, get, create, and search contacts (customers and suppliers)", invoices: "Invoice management - list, get, create invoices and update their status", payments: "Payment management - list, get, and create payments against invoices", accounts: "Chart of accounts - list and view account details by type and class", reports: "Financial reports - profit & loss, balance sheet, aged receivables, and aged payables", };