create-address
Generate accurate shipping addresses by inputting name, street, city, country, and zip details. Simplify address creation for orders and subscriptions on Terminal.shop MCP Server.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| city | Yes | ||
| country | Yes | ||
| name | Yes | ||
| phone | No | ||
| province | No | ||
| street1 | Yes | ||
| street2 | No | ||
| zip | Yes |
Implementation Reference
- server.js:869-895 (handler)The handler function for the 'create-address' tool. It sends a POST request to the Terminal.shop API to create a new shipping address using the provided parameters and returns the new address ID or an error message.async (params) => { try { const response = await terminalApi.post("/address", params); const addressID = response.data.data; return { content: [ { type: "text", text: `Address created successfully! Address ID: ${addressID}`, }, ], }; } catch (error) { console.error("Error creating address:", error); return { content: [ { type: "text", text: `Error creating address: ${error.message}`, }, ], isError: true, }; } }, );
- server.js:860-867 (schema)Zod schema defining the input parameters for the 'create-address' tool, including required fields like name, street1, city, country, zip, and optional fields.name: z.string(), street1: z.string(), street2: z.string().optional(), city: z.string(), province: z.string().optional(), country: z.string().length(2), zip: z.string(), phone: z.string().optional(),
- server.js:857-858 (registration)Registration of the 'create-address' tool on the MCP server using server.tool method.server.tool( "create-address",