search_companies_by_address
Find Swiss companies registered at a specific address or locality using open data. Input an address to retrieve company registrations with optional result limits.
Instructions
Search Swiss companies registered at a specific address or locality
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | Address or locality name | |
| limit | No | Max results (default: 20) |
Implementation Reference
- src/modules/companies.ts:94-110 (handler)The handler function implementation for the "search_companies_by_address" tool in src/modules/companies.ts.
case "search_companies_by_address": { const body = { name: args.address as string, maxEntries: (args.limit as number) ?? 20, languageKey: "en", }; const response = await fetch(`${BASE}/firm/search.json`, { method: "POST", headers: { "Content-Type": "application/json", "Accept": "application/json" }, body: JSON.stringify(body), }); if (response.status === 404) return JSON.stringify({ companies: [], hasMoreResults: false }, null, 2); if (!response.ok) throw new Error(`HTTP ${response.status}: ${response.statusText}`); const data = await response.json() as { list?: unknown[]; hasMoreResults?: boolean; error?: unknown }; if (data.error) return JSON.stringify({ companies: [], hasMoreResults: false }, null, 2); return JSON.stringify({ companies: data.list ?? [], hasMoreResults: data.hasMoreResults ?? false }, null, 2); } - src/modules/companies.ts:32-42 (schema)The registration and schema definition for "search_companies_by_address".
name: "search_companies_by_address", description: "Search Swiss companies registered at a specific address or locality", inputSchema: { type: "object", required: ["address"], properties: { address: { type: "string", description: "Address or locality name" }, limit: { type: "number", description: "Max results (default: 20)" }, }, }, },