create_address
Creates a permanent 9-digit Anwani address code from user-provided map coordinates and returns its code and URL. Use it to register new places; ask for real latitude/longitude instead of inventing them.
Instructions
Creates one new permanent 9-digit Anwani address within the account quota and returns {ok, code, created, url}. Requires a real user-provided latitude/longitude (map pin) — NEVER invent coordinates, city, or name; if the user gave no location (coords, Maps link, or clear place), ask first and do not call with sample data. Use it for new places; use patch_address to edit an existing code. Not idempotent unless the same idempotency_key is retried, which returns the original result.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"idempotency_key": "<idempotency_key>",
"latitude": "<latitude>",
"longitude": "<longitude>"
},
"name": "create_address"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pin | No | Optional 4-digit privacy PIN that couriers must enter to view details. Example: 4821 | |
| city | No | City only if the user provided it. Example: الرياض | |
| floor | No | Floor / level of the unit. Example: 5 or G | |
| label | No | Short friendly label for the address. Example: البيت or المكتب | |
| phone | No | Contact phone in international or local form if provided. Example: +9665xxxxxxx | |
| street | No | Street name if the user provided it. Example: شارع التحلية | |
| country | No | Country name or ISO-ish label if provided. Example: السعودية or SA | |
| category | No | Optional category tag. Example: home, work, shop | |
| latitude | Yes | User-provided latitude only — never invent. Example: 24.7136 | |
| longitude | Yes | User-provided longitude only — never invent. Example: 46.6753 | |
| ownerName | No | Display name for the address owner only if the user provided one. Example: أحمد | |
| pinEnabled | No | When true, details stay locked until the correct 4-digit PIN is entered. Example: true | |
| postalCode | No | Postal / ZIP code if provided. Example: 13521 | |
| houseNumber | No | House / unit number if provided. Example: 12 | |
| buildingName | No | Building name if provided. Example: برج الملقا | |
| instructions | No | Delivery notes for the courier (door color, buzzer, landmark). Example: الباب الأصفر، دق الجرس | |
| neighborhood | No | Neighborhood / district if provided. Example: حي الملقا | |
| idempotency_key | Yes | Client-generated key to safely retry the same create without duplicates. Example: create-2026-11-16-home-a1b2c3d4 | |
| saudiNationalCode | No | Optional Saudi national short code (4 letters + 4 digits, AAAA####) when country is SA. Does not replace the Anwani 9-digit code. Example: RADC2959 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | No | True when the request succeeded. | |
| url | No | Public link https://9code.app/code/{code}. | |
| code | No | New permanent 9-digit Anwani address code. | |
| created | No | True when a new address was made. |