pohoda_update_address
Modify address details in the POHODA addressbook by ID. Update fields like name, street, city, contact information, and business identifiers.
Instructions
Update an existing address in POHODA addressbook by ID. Provide id (required) and any fields to update: name, street, city, zip, ico, dic, email, phone, web, note.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Address ID to update (required) | |
| name | No | Company or contact name | |
| street | No | Street address | |
| city | No | City | |
| zip | No | ZIP/postal code | |
| ico | No | IČO (company ID number) | |
| dic | No | DIČ (VAT ID) | |
| No | Email address | ||
| phone | No | Phone number | |
| web | No | Website URL | |
| note | No | Note or comment |
Implementation Reference
- src/tools/addresses.ts:108-141 (handler)The handler function that constructs the XML and performs the POHODA update request.
async (params) => { try { const xml = buildImportDoc({ ico: client.ico }, (item) => { const adb = item.ele(NS.adb, "adb:addressbook").att("version", "2.0"); const actionType = adb.ele(NS.adb, "adb:actionType"); const update = actionType.ele(NS.adb, "adb:update"); const filter = update.ele(NS.ftr, "ftr:filter"); filter.ele(NS.ftr, "ftr:id").txt(String(params.id)); const header = adb.ele(NS.adb, "adb:addressbookHeader"); const hasIdentity = params.name ?? params.street ?? params.city ?? params.zip ?? params.ico ?? params.dic; if (hasIdentity) { header.ele(NS.adb, "adb:addressbookType").txt("company"); const identity = header.ele(NS.adb, "adb:identity"); const typAddr = identity.ele(NS.typ, "typ:address"); if (params.name) typAddr.ele(NS.typ, "typ:name").txt(params.name); if (params.street) typAddr.ele(NS.typ, "typ:street").txt(params.street); if (params.city) typAddr.ele(NS.typ, "typ:city").txt(params.city); if (params.zip) typAddr.ele(NS.typ, "typ:zip").txt(params.zip); if (params.ico) typAddr.ele(NS.typ, "typ:ico").txt(params.ico); if (params.dic) typAddr.ele(NS.typ, "typ:dic").txt(params.dic); } if (params.email) header.ele(NS.adb, "adb:email").txt(params.email); if (params.phone) header.ele(NS.adb, "adb:phone").txt(params.phone); if (params.web) header.ele(NS.adb, "adb:web").txt(params.web); if (params.note) header.ele(NS.adb, "adb:note").txt(params.note); }); const response = await client.sendXml(xml); const result = extractImportResult(parseResponse(response)); return result.success ? ok(`Address updated successfully. ${result.message}`) : err(result.message); } catch (e) { return err((e as Error).message); } } - src/tools/addresses.ts:95-107 (schema)Input schema definition for the pohoda_update_address tool.
{ id: z.number().describe("Address ID to update (required)"), name: z.string().optional().describe("Company or contact name"), street: z.string().optional().describe("Street address"), city: z.string().optional().describe("City"), zip: z.string().optional().describe("ZIP/postal code"), ico: z.string().optional().describe("IČO (company ID number)"), dic: z.string().optional().describe("DIČ (VAT ID)"), email: z.string().optional().describe("Email address"), phone: z.string().optional().describe("Phone number"), web: z.string().optional().describe("Website URL"), note: z.string().optional().describe("Note or comment"), }, - src/tools/addresses.ts:92-94 (registration)Registration of the pohoda_update_address tool.
server.tool( "pohoda_update_address", "Update an existing address in POHODA addressbook by ID. Provide id (required) and any fields to update: name, street, city, zip, ico, dic, email, phone, web, note.",