update_account
Modify account details like name, contact information, and company data for existing users in the ConsignCloud system.
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 server tool handler for 'update_account'. Parses arguments, calls client.updateAccount, and returns JSON response.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 validation for the 'update_account' tool defining parameters like id (required), names, company, email, phone.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() array, including name, description, and input schema for listing via ListToolsRequest.{ 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 updateAccount in ConsignCloudClient: converts data (handles balance cents), PATCH /accounts/{id}, converts response.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); }