update_account
Modify existing account details like contact information, company name, or phone number to maintain accurate vendor records in consignment operations.
Instructions
Update an existing account
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| first_name | No | ||
| last_name | No | ||
| company | No | ||
| No | |||
| phone_number | No |
Implementation Reference
- src/server.ts:469-471 (handler)MCP tool handler for 'update_account': extracts account ID and update data from arguments, calls client.updateAccount, and returns the JSON-stringified result.case 'update_account': const { id: accountId, ...accountData } = args as any; return { content: [{ type: 'text', text: JSON.stringify(await client.updateAccount(accountId, accountData), null, 2) }] };
- src/server.ts:181-192 (schema)Input schema definition for the 'update_account' tool, specifying required 'id' and optional account fields.inputSchema: { type: 'object', properties: { id: { type: 'string' }, first_name: { type: 'string' }, last_name: { type: 'string' }, company: { type: 'string' }, email: { type: 'string' }, phone_number: { type: 'string' }, }, required: ['id'], },
- src/server.ts:178-193 (registration)Tool registration in createTools(): defines name, description, and inputSchema for 'update_account'.{ name: 'update_account', description: 'Update an existing account', inputSchema: { type: 'object', properties: { id: { type: 'string' }, first_name: { type: 'string' }, last_name: { type: 'string' }, company: { type: 'string' }, email: { type: 'string' }, phone_number: { type: 'string' }, }, required: ['id'], }, },
- src/client.ts:218-226 (helper)Core implementation of account update: converts data (handling currency), sends PATCH request to API, and converts response back to client model.async updateAccount(id: string, data: Partial<Account>): Promise<Account> { // Convert user input to API cents const apiData = { ...data, balance: data.balance ? this.convertToApiCents(data.balance) : undefined, }; const response = await this.client.patch(`/accounts/${id}`, apiData); return this.convertAccountResponse(response.data); }