add_party_address
Append a single postal address to a party using one PUT request. Country validation ensures accepted names only.
Instructions
Append a single postal address to a party. Atomic — one PUT to Capsule. Use this instead of update_party.addresses for single-entry adds.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| partyId | Yes | ||
| street | No | ||
| city | No | ||
| state | No | ||
| country | No | Country name. Capsule validates this against a small canonical-English-name dictionary; inputs not in the dictionary are REJECTED with 422 'address.country: unknown country' (NOT silently passed through or normalised). Probed examples — accepted: `United States`, `United Kingdom`, `Czechia`, `Germany`. Aliased: `USA → United States`. Rejected: `United States of America`, `Czech Republic` (use `Czechia`), `UK`/`Britain` (use `United Kingdom`), `Deutschland` (use `Germany`). Empty string is accepted and stored as `null` — a de-facto 'clear' shape. To discover an accepted name, read an existing party that already has the country set. | |
| zip | No | ||
| type | No | Free-form label, e.g. 'Office', 'Home'. |
Implementation Reference
- src/server/register-tool.ts:39-59 (helper)Generic helper used to register MCP tools. Wraps the handler return value in the standard MCP text-content response shape.
export function registerTool<Schema extends z.ZodObject<ZodRawShape>>( server: McpServer, name: string, description: string, schema: Schema, handler: (input: z.infer<Schema>) => Promise<unknown>, ): void { // Use the SDK config-form registerTool with the full Zod schema. The // deprecated shape overload rebuilds z.object(schema.shape), which drops // object-level refinements such as superRefine. const registerWithSchema = server.registerTool.bind(server) as ( toolName: string, config: { description: string; inputSchema: Schema }, callback: (input: z.infer<Schema>) => Promise<CallToolResult>, ) => void; registerWithSchema(name, { description, inputSchema: schema }, async (input) => { const result = await handler(input); return wrapAsText(result); }); }