update_batch_status
Change batch processing status between draft and submitted states in ConsignCloud to manage consignment workflows.
Instructions
Update batch status (draft or submitted)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Batch ID | |
| status | Yes |
Implementation Reference
- src/server.ts:505-507 (handler)MCP tool handler that destructures arguments and invokes the client method to update batch status, returning JSON response.
case 'update_batch_status': const { id: batchId, status } = args as any; return { content: [{ type: 'text', text: JSON.stringify(await client.updateBatchStatus(batchId, status), null, 2) }] }; - src/server.ts:314-325 (schema)Input schema definition and tool metadata for update_batch_status.
{ name: 'update_batch_status', description: 'Update batch status (draft or submitted)', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Batch ID' }, status: { type: 'string', enum: ['draft', 'submitted'] }, }, required: ['id', 'status'], }, }, - src/client.ts:258-261 (helper)Core helper function in the client that performs the HTTP POST request to the ConsignCloud API endpoint to update the batch status.
async updateBatchStatus(id: string, status: 'draft' | 'submitted'): Promise<Batch> { const response = await this.client.post(`/batches/${id}/status`, { status }); return response.data; } - src/server.ts:418-420 (registration)Registers the list tools handler which exposes the update_batch_status tool via the createTools() array.
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools, }));