Skip to content

feat: add account management tools (create, update, archive)#148

Open
sbs44 wants to merge 1 commit intoXeroAPI:mainfrom
sbs44:feat/account-management-tools
Open

feat: add account management tools (create, update, archive)#148
sbs44 wants to merge 1 commit intoXeroAPI:mainfrom
sbs44:feat/account-management-tools

Conversation

@sbs44
Copy link
Copy Markdown

@sbs44 sbs44 commented Apr 8, 2026

Summary

Adds three new MCP tools for managing Xero chart of accounts:

  • create-account — Create accounts with name, code, type, and optional description, taxType, and bankAccountNumber
  • update-account — Update account fields including name, code, type, description, taxType, currencyCode, enablePaymentsToAccount, showInExpenseClaims, reportingCode, reportingCodeName, and addToWatchlist
  • archive-account — Convenience tool to archive an account by setting its status to ARCHIVED via updateAccount()

All three tools return a deep link to view the account in Xero.

Changes

New files (6):

  • src/handlers/create-xero-account.handler.ts
  • src/handlers/update-xero-account.handler.ts
  • src/handlers/archive-xero-account.handler.ts
  • src/tools/create/create-account.tool.ts
  • src/tools/update/update-account.tool.ts
  • src/tools/update/archive-account.tool.ts

Modified files (4):

  • src/consts/deeplinks.ts — added accountDeepLink()
  • src/helpers/get-deeplink.ts — added ACCOUNT to DeepLinkType enum and switch
  • src/tools/create/index.ts — registered CreateAccountTool
  • src/tools/update/index.ts — registered UpdateAccountTool and ArchiveAccountTool

Design decisions

  • archive-account as a dedicated tool rather than a flag on update-account, since archiving is a distinct user intent
  • archive-account lives in src/tools/update/ since it's implemented as an updateAccount() call under the hood
  • create-account is intentionally lean (core fields only) — niche fields like reportingCode can be set via update-account after creation
  • All handlers and tools follow existing codebase patterns exactly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant