{"version":"1.0","service":"agent-broker","tools":[{"type":"function","function":{"name":"find_business","description":"Find real businesses near a place, sorted by distance (nearest of those examined; see result.search). Data: OpenStreetMap (ODbL, (c) OSM contributors); phone, website, hours only when mapped. Coverage varies; community-mapped, NOT verified by us; source=openstreetmap rows cannot be booked. Answers within about 5 s: status partial (search_in_progress) means repeat the call. If OSM is down: retriable 'temporarily unavailable', never invented rows. [beta] Use when: Use when an agent needs real businesses of a given kind near a place: to show options, get contact details, or pick a target. Rows with source=supply_network (added through booking URLs) can then be booked with schedule_appointment; rows with source=openstreetmap are for contact details, not booking. Do NOT use when: Do not use as a bulk directory or scraping surface: results are capped at 20, fresh lookups are rate limited per caller, and the public OpenStreetMap servers behind this are a shared free service. Do not use when you already have a specific SMB identifier. Do not assume an OpenStreetMap result is verified, open right now, or bookable. Cost: free (no key required).","parameters":{"type":"object","required":["location"],"properties":{"vertical":{"type":"string","enum":["personal_services","home_services","professional_services"]},"location":{"type":"object","required":["zip_or_city"],"properties":{"zip_or_city":{"type":"string","description":"Town, city, address or postal code, with the country if not US: 'Nizwa, Oman'. A bare 5-digit ZIP is a US ZIP; add the country for any other postal code."},"radius_miles":{"type":"number","minimum":0,"description":"Radius in miles (default 3.1, max 25); applies to OpenStreetMap results only."}},"description":"City/town or ZIP, optionally with country ('Nizwa, Oman'). Geocoded by OSM."},"capability":{"type":"string","description":"Kind of business: 'dentist', 'cafe', 'plumber'. Use it or vertical."},"price_band":{"type":"object","properties":{"max_usd":{"type":"number"}},"description":"Supply-network rows only (OpenStreetMap has no prices)."},"availability_window":{"type":"object","properties":{"start_iso":{"type":"string","format":"date-time"},"end_iso":{"type":"string","format":"date-time"}},"description":"Accepted but NOT APPLIED: it does not narrow results (no live calendars). The result says availability_window_applied: false. To book a slot use schedule_appointment requested_time."},"max_results":{"type":"integer","default":5,"maximum":20,"minimum":1},"city":{"type":"string","description":"Instead of location: a city, e.g. 'Muscat, Oman'."},"region":{"type":"string","description":"With city: a state or region."}}}}},{"type":"function","function":{"name":"verify_business","description":"Look up what we know about a business in our supply network: contact channels, capabilities, last verification. A DIRECTORY LOOKUP - it does not contact the business. Supply-network ids only, not osm:... ids. [limited] Use when: Use before sending communications or scheduling if you have an unverified SMB identifier, or if the agent's task requires confirmed capability (e.g., 'I need to be sure they do emergency plumbing'). Do NOT use when: Do not use if the SMB was returned from find_business within the last 24 hours — those results are already verified. Cost: free (no key required).","parameters":{"type":"object","required":["smb_id"],"properties":{"smb_id":{"type":"string"},"capability_to_verify":{"type":"string"}}}}},{"type":"function","function":{"name":"send_message","description":"Send a message on behalf of an agent's user or an SMB across WhatsApp (free during launch), SMS, email, or voice, sent immediately, no scheduling. Every send passes a non-bypassable gate: TCPA, GDPR, CASL where modeled, else the service's own opt-in default (the Gulf included). Marketing on SMS, voice, WhatsApp and non-US email without recorded opt-in is rejected (compliance_violation receipt). US marketing email follows CAN-SPAM opt-out rules. Use when: Use to: (a) confirm a booking the agent just made, (b) reply to a customer who messaged the SMB first, (c) follow up on a quote the user requested, (d) send appointment reminders the SMB owes its customer, (e) send marketing messages to recipients who have opted in. Where opt-in is required (everything except US marketing email, which follows CAN-SPAM opt-out rules) the gate verifies it on every send. Do NOT use when: Do NOT use for OTPs or critical transactional confirmations — use send_transactional_confirmation. Do NOT attempt to send SMS, voice, WhatsApp or non-US email marketing without a recorded opt-in — the gate will reject the send and log a compliance_violation (US marketing email follows CAN-SPAM opt-out rules instead). Do NOT attempt bulk / list-based / drip / cold outreach — those are out of scope and the rate limiter will throttle abuse. Cost: from $0.02 per call, up to $0.22 (call preview_cost for the exact price; not charged while no payment rail is on). Execution: sync_fast — returns pending_async.","parameters":{"type":"object","required":["recipient","message_type","content"],"properties":{"recipient":{"type":"object","required":["id_type","id_value"],"properties":{"id_type":{"type":"string","enum":["phone","email","smb_id","customer_id"]},"id_value":{"type":"string"},"country_code":{"type":"string","description":"ISO 3166-1 alpha-2, required for compliance routing"}}},"message_type":{"type":"string","description":"'marketing' needs recorded opt-in, except US email (CAN-SPAM opt-out rules). Five types. The gate checks the opt-in at send time and rejects the send (compliance_violation receipt) if it is missing, expired, or revoked.","enum":["transactional","marketing","reminder","follow_up","notification"]},"content":{"type":"object","required":["body"],"properties":{"body":{"type":"string"},"subject":{"type":"string","description":"For email channel"},"template_id":{"type":"string"},"template_vars":{"type":"object"}}},"preferred_channel":{"type":"string","enum":["whatsapp","sms","email","voice","auto"],"default":"auto"},"on_behalf_of":{"type":"string","description":"Who this message is FOR (your end-user's name/label). On WhatsApp this opens a tracked conversation and travels in-message as '#4821 for Sara (via HatchLoop)', so the business knows who it is talking to and their reply is matched back to this exact request instead of guessed. Strongly recommended for two-way channels."},"business_id":{"type":"string","description":"Stable id for the recipient business; used for global demand shaping."}}}}},{"type":"function","function":{"name":"capture_lead","description":"Structured intake of a prospect into an SMB's funnel with validation and deduplication on (smb_id, phone or email). Stored in AgentBroker's own lead funnel, NOT the business's CRM; the business is not notified. [beta] Use when: Use when a potential customer has expressed interest in an SMB's service and you want to ensure they are registered in the SMB's pipeline for follow-up. Do NOT use when: Do not use for confirmed bookings — use schedule_appointment. Do not use for bulk list imports. Cost: $0.05 per call (not charged while no payment rail is on). Execution: sync_fast — returns pending_async.","parameters":{"type":"object","required":["smb_id","prospect"],"properties":{"smb_id":{"type":"string"},"prospect":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"phone":{"type":"string"},"email":{"type":"string","format":"email"},"service_interest":{"type":"string"},"notes":{"type":"string"},"consent_record_id":{"type":"string","description":"Optional ID of a consent record proving the prospect asked to be contacted (e.g., they filled an SMB's intake form or requested a quote). Required when downstream send_message calls are anticipated."}}},"source":{"type":"string","description":"Where the consumer-initiated request originated (e.g., 'consumer_request', 'inbound_quote_form', 'agent_referral_from_find_business')."}}}}},{"type":"function","function":{"name":"schedule_appointment","description":"Check availability, book, or cancel via Cal.com. Only completes when the SMB's imported booking link is bound to this deployment's ONE connected Cal.com account; otherwise fails honestly (booking_destination_unmapped) with no charge. No working booking path exists yet for non-Cal.com platforms (voice AI, web form) — those SMBs fail honestly instead of a fabricated confirmation. [limited] Use when: Use to book, check availability, or cancel a Cal.com appointment once the SMB is verified and its booking link is bound to our connected Cal.com account. Requires a verified smb_id. Do NOT use when: Do not use for bulk scheduling. Do not use without a verified SMB — call find_business and verify_business first if needed. Do not pass action=reschedule — it is not implemented; cancel the existing appointment and book a new time instead. Do not expect this to book on the SMB's own Calendly/Doctolib/Booksy/Fresha/etc. account, or on a Cal.com account other than the one this deployment holds credentials for — those calls fail honestly with no charge. Cost: from $0.15 per call, up to $0.5 (call preview_cost for the exact price; not charged while no payment rail is on). Execution: async_by_default — returns pending_async.","parameters":{"type":"object","required":["smb_id","action"],"properties":{"smb_id":{"type":"string"},"action":{"type":"string","enum":["book","cancel","check_availability"]},"service":{"type":"string"},"customer":{"type":"object","properties":{"name":{"type":"string"},"phone":{"type":"string"},"email":{"type":"string"}}},"requested_time":{"type":"object","properties":{"preferred_iso":{"type":"string","format":"date-time"},"window_start_iso":{"type":"string","format":"date-time"},"window_end_iso":{"type":"string","format":"date-time"},"duration_minutes":{"type":"integer"}}},"existing_appointment_id":{"type":"string","description":"Required for cancel"},"notes":{"type":"string"}}}}},{"type":"function","function":{"name":"send_transactional_confirmation","description":"Idempotent transactional messages: OTPs, booking confirmations, payment receipts, cancellation notices. Falls back across configured channels; an unconfigured channel fails honestly rather than reporting a delivery that did not happen. Use when: Use for any message that MUST be delivered reliably — OTPs, booking confirmations, receipts. Do not use for marketing. Do NOT use when: Do not use for marketing or promotional messages. Do not use for conversational messages. Cost: $0.02 per call (not charged while no payment rail is on). Execution: sync_fast — returns pending_async.","parameters":{"type":"object","required":["recipient","confirmation_type","data"],"properties":{"recipient":{"type":"object","required":["phone_or_email"],"properties":{"phone_or_email":{"type":"string"},"name":{"type":"string"}}},"confirmation_type":{"type":"string","enum":["otp","booking_confirmation","payment_receipt","cancellation_notice","reminder"]},"data":{"type":"object","description":"Type-specific payload; e.g., {otp_code} for otp, {appointment_time, smb_name} for booking_confirmation"},"preferred_channel":{"type":"string","enum":["sms","email","auto"],"default":"sms"}}}}},{"type":"function","function":{"name":"handle_inbound","description":"Classify an inbound message for an SMB and get a suggested_action for YOUR agent to act on. English keyword rules (booking request, cancellation, opt-out, inquiry, complaint): treat the intent as a hint. Opt-outs are recorded durably; nothing else is auto-routed or executed. [beta] Use when: Use when an SMB needs inbound message triage — classifying incoming contact-form submissions, SMS replies, voicemails, or email inquiries. Do NOT use when: Do not use for outbound communications. Do not use for compliance-flagged recipient lists without verified opt-in records. Cost: $0.03 per call (not charged while no payment rail is on). Execution: async_by_default — returns pending_async.","parameters":{"type":"object","required":["smb_id","inbound_channel","raw_message"],"properties":{"smb_id":{"type":"string"},"inbound_channel":{"type":"string","enum":["sms","email","voice_voicemail","web_form","api"]},"sender":{"type":"object","properties":{"phone":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"}}},"raw_message":{"type":"string"},"received_at_iso":{"type":"string","format":"date-time"},"routing_rules":{"type":"object","description":"Optional override routing policy for this SMB"}}}}},{"type":"function","function":{"name":"escalate_to_human","description":"Hand off an in-flight task to a human operator with a context bundle (transcript, prior actions, identifiers, recommended next step). Writes a ticket to the operator queue; sends no notification, promises no response time. [beta] Use when: Use when automated resolution has failed after channel-fallback exhaustion, when the task requires human judgment, or when the customer has explicitly requested human contact. Do NOT use when: Do not use as a first resort. Escalate only after automated resolution attempts. Cost: $0.2 per call (not charged while no payment rail is on). Execution: async_by_default — returns pending_async.","parameters":{"type":"object","required":["smb_id","reason","context"],"properties":{"smb_id":{"type":"string"},"reason":{"type":"string","enum":["automation_failed","customer_requested","compliance_hold","ambiguous_intent","exception_required"]},"context":{"type":"object","properties":{"original_operation":{"type":"string"},"operation_id":{"type":"string"},"transcript":{"type":"array","items":{"type":"object"}},"prior_actions":{"type":"array","items":{"type":"object"}},"recommended_next_step":{"type":"string"}}},"priority":{"type":"string","enum":["normal","urgent"],"default":"normal"}}}}},{"type":"function","function":{"name":"get_status","description":"Query the current state of any in-flight async operation by operation_id. Use when: Use to poll the state of a pending_async operation when no webhook callback has arrived or to check progress. Do NOT use when: Do not poll more frequently than once per 10 seconds — use webhook delivery for real-time updates instead. Cost: free (no key required).","parameters":{"type":"object","required":["operation_id"],"properties":{"operation_id":{"type":"string"}}}}},{"type":"function","function":{"name":"get_outcome","description":"Retrieve the final OutcomeReceipt for a completed operation. Use when: Use after get_status returns success/failure/partial to retrieve the full result with cost and reason codes. Do NOT use when: Do not use for operations still in pending/executing state — use get_status first. Cost: free (no key required).","parameters":{"type":"object","required":["operation_id"],"properties":{"operation_id":{"type":"string"}}}}},{"type":"function","function":{"name":"preview_cost","description":"Return an expected cost estimate, latency estimate, and success-probability estimate for a proposed call before execution. Returns the exact price when it is fixed, and a min/max range when the cost depends on channel or outcome. It does not promise an accuracy percentage - check cost_range. Use when: Use before any operation when the agent is operating under a budget constraint and needs to decide whether to proceed. Do NOT use when: Do not use in a hot loop — cache the result for at least 60 seconds if repeating the same preview. Cost: free (no key required).","parameters":{"type":"object","required":["operation","params"],"properties":{"operation":{"type":"string"},"params":{"type":"object","description":"The same request body you would pass to the operation"}}}}},{"type":"function","function":{"name":"self_test","description":"Service health probe: runs 6 internal checks and reports how many passed. Confirms the server is up and responding - it does NOT probe each tool individually. Use to verify connectivity before production use. Use when: Use at agent startup, before high-stakes task sequences, or after receiving unexpected errors to check if the service is degraded. Do NOT use when: Do not call more than once per minute in production. Cost: free (no key required).","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"check_quota","description":"Returns the caller's current quota state: how many operations have been used today, how many remain, the daily limit, the tier (free / credits / unlimited), and when the quota resets. Read-only and free. Works with any valid X-Agent-Identity token; returns tier='anonymous' for keyless callers with the anonymous daily limits. Use when: Call at session start or before a batch of write operations to confirm you have enough remaining quota. Use when a user asks how many API calls they have left today. Also useful after a rate_limited error to understand when the quota resets. Do NOT use when: Do not call on every single tool invocation — quota is also injected into every write-tool response in the 'quota' field. Only call proactively when you need the current state without performing an operation. Cost: free (no key required).","parameters":{"type":"object","required":[],"properties":{}}}},{"type":"function","function":{"name":"check_booking_link","description":"Free, instant pre-flight check for a booking URL. Classifies which booking platform a URL belongs to and tells you whether import_booking_url will accept it, WITHOUT fetching the page or spending money. Returns the platform, the exact smb_id import_booking_url would assign, the channels the booking will route through, and the inferred country. Use it to de-risk a paid booking BEFORE calling import_booking_url + schedule_appointment. Use when: Call this the moment a user pastes a URL and you are not sure it is a bookable page, or before you commit to a paid schedule_appointment. It is free and sub-100ms, so run it as a guard: if supported=true, proceed to import_booking_url with confidence; if supported=false, fall back to find_business or call_business instead of wasting a booking attempt. Do NOT use when: Do not use to confirm the page is currently live/available — this tool does not fetch the URL, it only classifies its shape. It is not a substitute for import_booking_url (which actually registers the business) or verify_business (which confirms an already-imported smb_id). Cost: free (no key required).","parameters":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"Full http(s) URL to classify, e.g. 'https://cal.com/jane' or 'https://www.opentable.com/r/acme'."}}}}},{"type":"function","function":{"name":"import_booking_url","description":"Turn a public booking URL into a callable smb_id for send_message and capture_lead. But schedule_appointment only completes on Cal.com bound to our one connected account — the other 11 always fail schedule_appointment honestly, uncharged. Detects 12 platforms (Cal.com, Calendly, Doctolib, Booksy, Fresha, OpenTable, Setmore, Square, Acuity, Schedulista, Squarespace, BookMyCity). Idempotent — calling twice returns the same smb_id. [limited] Use when: Call this FIRST whenever the user provides a specific booking URL (cal.com/handle, calendly.com/handle/event, doctolib.fr/..., booksy.com/..., opentable.com/r/..., etc.). User patterns that match: 'book me at https://cal.com/...', 'schedule with calendly.com/jane/intro', 'reserve a table at opentable.com/r/...', 'I want to book this dentist: https://www.doctolib.fr/...'. After importing, the returned smb_id works immediately with send_message and capture_lead. It only completes a booking via schedule_appointment if the URL was a Cal.com link bound to this deployment's one connected account — every other platform gets an honest, uncharged refusal there, not a booking. Do NOT use when: Do not use if the user only describes a business by name without a URL — call find_business instead. Do not use for arbitrary websites that are not on the supported booking-platform list (use /supply/platforms to see all 12). Cost: free (no key required).","parameters":{"type":"object","required":["booking_url"],"properties":{"booking_url":{"type":"string","format":"uri","description":"Full URL the user supplied. Must point at one of the 12 supported booking platforms; auto-detected from the host."},"business_name":{"type":"string","description":"If omitted, auto-extracted from the page's <title> or og:title."},"vertical":{"type":"string","enum":["personal_services","home_services","professional_services","restaurants","retail","healthcare","fitness"],"description":"If omitted, inferred from the booking platform."},"country_code":{"type":"string","description":"ISO 3166-1 alpha-2 (e.g. 'US', 'FR'); routes compliance on later sends."},"contact_phone":{"type":"string","description":"If omitted, the platform integration handles outreach."},"contact_email":{"type":"string"},"capabilities":{"type":"array","items":{"type":"string"},"description":"Free-form capability tags (e.g., ['haircut','color','blowdry'])."}}}}},{"type":"function","function":{"name":"call_business","description":"Place a conversational voice-AI phone call to a business on a consumer's behalf; give a plain-language objective and it navigates the call, extracting the answer. Business-directed (B2B), far less restricted than calling consumers — but the compliance gate still enforces recording consent per jurisdiction. Use when: Use when the target business has NO booking URL and NO API — only a phone number — and the consumer asked the agent to reach them (e.g. 'call this plumber and ask if they can come Tuesday', 'ask the salon if they take walk-ins this afternoon'). Also use to confirm details a booking page doesn't expose (real-time availability, custom quotes). Do NOT use when: Do NOT use when the business has a booking URL — use import_booking_url + schedule_appointment (cheaper, faster, deterministic). Do NOT use for calls to consumers/individuals (this tool is for reaching businesses). Do NOT use for marketing or telemarketing — the compliance gate and the B2B-only framing reject that. Cost: $0.2 per call (not charged while no payment rail is on). Execution: async_by_default — returns pending_async.","parameters":{"type":"object","required":["objective"],"properties":{"business_phone":{"type":"string","description":"Business phone in E.164 (e.g. +14045550123). Provide this OR smb_id."},"smb_id":{"type":"string","description":"Known SMB identifier with a phone on record. Provide this OR business_phone."},"objective":{"type":"string","description":"What the call should accomplish, in plain language."},"extract_fields":{"type":"array","items":{"type":"string"},"description":"Structured fields to pull from the answer, e.g. ['available_tomorrow','price_quote','earliest_slot']."},"country_code":{"type":"string","description":"ISO 3166-1 alpha-2 for compliance + recording-consent routing."},"on_behalf_of":{"type":"string","description":"Name of the consumer the call is placed for."},"max_duration_seconds":{"type":"integer","maximum":600,"default":180}}}}},{"type":"function","function":{"name":"check_compliance","description":"Free, instant pre-flight for the compliance gate: runs the SAME TCPA/GDPR/CASL/CAN-SPAM/10DLC checks as send_message and call_business, in preview mode -- nothing is sent, nothing changes. Tells you whether a send would be permitted before you pay, and if not, names the exact rule and how to fix it. De-risks a paid send the way check_booking_link de-risks a paid booking. Use when: Call this the moment before send_message or call_business when there is any chance the send is regulated — anything tagged marketing, any SMS to a US number (10DLC), any message to an EU/UK (GDPR) or Canadian (CASL) recipient, or any content you are unsure about. It is free and sub-100ms, so run it as a guard: if legal=true, proceed to send_message with confidence; if legal=false, fix the cited blocker instead of burning a paid, rejected send. Do NOT use when: Do not treat a legal=true as a permanent license — the gate re-runs at send time, so a fresh opt-out between preview and send still blocks. Do not use it to check two-party voice recording consent (that is evaluated at call time in the voice adapter, not here). It is not a substitute for send_message; it never delivers anything. Cost: free (no key required).","parameters":{"type":"object","required":["recipient_id","content"],"properties":{"recipient_id":{"type":"string","description":"Phone in E.164 (e.g. '+14045550100') or email address the message would go to."},"content":{"type":"string","description":"The actual message body you intend to send. The gate classifies the real text, so a meaningful preview needs the real content."},"channel":{"type":"string","enum":["sms","email","voice"],"description":"Delivery channel. Omit to auto-infer sms/email from recipient_id; set 'voice' explicitly."},"message_type":{"type":"string","description":"One of transactional, marketing, reminder, follow_up, notification (any case). Any other value is refused. 'marketing' triggers the consent checks. Defaults to transactional.","default":"transactional"},"country_code":{"type":"string","description":"ISO 3166-1 alpha-2 (e.g. 'US', 'DE', 'CA'). Auto-inferred from phone if omitted; drives which jurisdiction rules apply."},"state_code":{"type":"string","description":"US state code (e.g. 'CA') for state-specific rules."}}}}},{"type":"function","function":{"name":"verify_company_record","description":"Free, live lookup of a company official registry record. Queries the GLEIF global LEI registry (primary, 2.6 million legal entities worldwide) and SEC EDGAR (US public companies) to return the official legal name, LEI, entity status, jurisdiction, registered address, and registry authority. Never fabricates: if the company is not found in these free registries, returns an honest not_found with the sources that were queried. Use when: Use when you need to verify that a company exists as a registered legal entity and retrieve its official registry details -- before signing a contract, qualifying a vendor, validating a counterparty, or populating a due-diligence record. Accepts a legal name plus optional country filter or a direct LEI for a precise lookup. Do NOT use when: Do not use to verify private companies not registered with GLEIF or SEC. Do not use as an exhaustive fraud-detection tool; this is a first-pass existence check against free public registries, not a full KYC screen. Cost: free (no key required).","parameters":{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"Legal company name to look up, e.g. Apple Inc or Volkswagen AG."},"country":{"type":"string","description":"Optional ISO 3166-1 alpha-2 country filter (e.g. US, DE, GB). Narrows GLEIF results to one jurisdiction."},"lei":{"type":"string","description":"Optional 20-character Legal Entity Identifier for a direct, precise lookup."}}}}},{"type":"function","function":{"name":"screen_sanctions","description":"Free screening of a name/entity (Latin or Arabic script) against sanctions lists: OFAC SDN (US Treasury), EU consolidated list (European Commission), UK Sanctions List (FCDO). THE UN CONSOLIDATED LIST IS NOT SCREENED -- no licence permits redistribution. Never fabricates a match or clear: check lists_screened; reason_code 'partial_screening' (never 'clear') if any source failed. Use when: Use before onboarding a counterparty, processing a payment, engaging a vendor, or doing any due-diligence step that requires knowing whether a person or entity appears on official sanctions lists. Essential for agents doing business formation, vendor qualification, payments onboarding, trade compliance, or any workflow where a sanctioned counterparty is a legal or reputational risk. Do NOT use when: Do not use as a substitute for full KYC/AML screening -- this covers sanctions lists only, not PEP (Politically Exposed Person) databases, adverse media, or credit risk. Do not treat a negative result as a compliance clearance; it is informational only. Do not use for bulk screening of large lists -- each call is a live API query. Arabic names are matched by transliteration, which is lossy: sound-alikes come back as graded candidates (match_confidence, token_alignment), never as findings; the one exception is an Arabic-script name equal to an Arabic alias a list prints. An Arabic query with no hits is 'partial', never 'clean'. Cost: free (no key required).","parameters":{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"Name of the person or entity to screen, in Latin or Arabic script, e.g. 'Kim Jong-un' or 'ACME Trading LLC'. Use the most complete name available. Arabic names are also matched by sound across spellings."},"country":{"type":"string","description":"Optional ISO 3166-1 alpha-2 country code or country name (e.g. 'IR', 'Iran'). It ANNOTATES AND RANKS results; it never removes any. Each EU/UK match carries country_match: true, false, or null when the listing records no country. Nothing is dropped on a mismatch, because the country we hold is the address/nationality on the listing rather than everywhere a party operates - excluding on it would return a clean screen for someone who IS listed."},"type":{"type":"string","enum":["person","entity"],"description":"Optional entity type hint. 'person' for individuals, 'entity' for organizations/companies. Omit to screen both."}}}}},{"type":"function","function":{"name":"map_trade_restriction","description":"Free cross-border screening of destination and parties: DOES NOT CLASSIFY THE PRODUCT: echoed back, never checked against export-control lists, so a controlled item to an unrestricted destination returns 'partial', never 'clear'. Not an export-control clearance -- classify HS/ECCN yourself. Never fabricates a tariff rate, a clear, or a restricted status. Use when: Use before any cross-border trade to flag embargoed destinations, screen exporters/importers/freight forwarders against sanctions lists, and get authoritative links to the applicable tariff databases. Call this as a pre-flight check before quoting, invoicing, or shipping internationally. Covers OFAC comprehensively-embargoed countries (Iran, North Korea, Cuba, Syria) and significant advisory countries (Russia, Belarus, Ukraine Crimea/DNR/LNR regions). Do NOT use when: Do NOT use as a substitute for a licensed export compliance review. Do NOT use to obtain authoritative tariff rates (this tool returns guidance links, never fabricated rates). Do NOT use for purely domestic shipments where no cross-border movement is involved. Cost: free (no key required).","parameters":{"type":"object","required":["product","destination_country"],"properties":{"product":{"type":"string","description":"Product name or description, e.g. 'laptop computers', 'crude oil', 'medical devices'. Used in the tariff guidance note."},"hs_code":{"type":"string","description":"Optional Harmonized System code (e.g. '8471.30' for laptops). If provided, echoed back and included in tariff guidance. Not derived -- caller must supply the official HS code."},"origin_country":{"type":"string","description":"Optional ISO 3166-1 alpha-2 code for the exporting country (e.g. 'US', 'DE'). Used in the tariff guidance note."},"destination_country":{"type":"string","description":"ISO 3166-1 alpha-2 code for the importing country (e.g. 'IR', 'CA', 'DE'). Required. Checked against the OFAC comprehensive-embargo map and sectoral-sanctions advisory list."},"parties":{"type":"array","maxItems":20,"items":{"type":"string"},"description":"Optional list of party names to screen (exporter, importer, freight forwarder, end-user, etc.). Each name is screened against OFAC SDN (US Treasury), the EU Consolidated list (European Commission) and the UK Sanctions List (FCDO). At most 20 parties per call - a longer list is refused outright (bad_input) rather than partially screened; split it across calls."}}}}},{"type":"function","function":{"name":"get_conversation","description":"Read a two-way conversation thread you started: its state, every message exchanged, and how many replies the business has sent. Use when: After send_message with on_behalf_of returns a conversation_id, poll this to read the business's reply. Replies are matched to the right thread exactly (never guessed), so what you read here belongs to YOUR end-user. Do NOT use when: Do not poll more often than every 10 seconds. Cost: free (no key required).","parameters":{"type":"object","properties":{"conversation_id":{"type":"string","description":"From the send_message receipt (preferred)."},"reference":{"type":"string","description":"The 4-digit request reference, e.g. '4821'. Requires business_number."},"business_number":{"type":"string","description":"Scopes a `reference` to one business (references are reused across businesses)."}}}}},{"type":"function","function":{"name":"mint_key","description":"Mint a free-tier API key without email by signing agent_id + timestamp + nonce with the MACHINE_MINT_SECRET (HMAC-SHA256). Refused without that secret (invalid_request); not_configured if the operator has none set. No secret: use POST /keys/request. [limited] Use when: Use when an AI agent needs to self-provision a write-capable API key without a human email address. The caller must know the MACHINE_MINT_SECRET (available from hatchloop.dev/docs/#machine-mint). Do NOT use when: Do not use if the agent has a human operator who can complete the email flow at /keys/request. Do not use for paid plans — this endpoint issues free-tier keys (100 ops/day) only. Cost: free (no key required).","parameters":{"type":"object","required":["agent_id","timestamp","nonce","signature"],"properties":{"agent_id":{"type":"string","description":"A stable unique identifier for this agent (e.g. a UUID). The issued key is deterministically tied to this ID."},"timestamp":{"type":"integer","description":"Unix epoch seconds at signing time. Must be within 60s of server time."},"nonce":{"type":"string","description":"Random value (UUID or hex). Prevents replay attacks — use a fresh nonce each call."},"signature":{"type":"string","description":"HMAC-SHA256(agent_id + str(timestamp) + nonce, MACHINE_MINT_SECRET) as lowercase hex. The HMAC input is the raw concatenation with no separators."}}}}},{"type":"function","function":{"name":"lookup_us_contracts","description":"Search US federal contract awards by company (recipient) name using the free USASpending.gov public API. Returns the top awards sorted by dollar amount: award ID, recipient name, award amount USD, awarding agency, NAICS code/description, and period of performance. Zero upstream cost, no key required. Data covers 2020-2026 procurement contracts. Use when: Use when you need to know whether a company is a US federal contractor, which government agencies have awarded it contracts, the dollar value and NAICS sector of those contracts, and the period of performance. Useful for supplier due-diligence, vendor qualification, competitive intelligence, and import/trade research. The target demand: \"us import data api\", \"supplier lookup api\", \"company trade records\", \"who has government contracts\", \"federal contractor search\". Do NOT use when: Do not use for non-US companies (USASpending.gov only covers US federal contracts). Do not use as an exhaustive financial-risk or sanctions screen -- use verify_company_record and screen_sanctions for those. Do not use for state/local government contracts (federal only). Cost: free (no key required).","parameters":{"type":"object","required":["company_name"],"properties":{"company_name":{"type":"string","description":"Company or recipient name to search for in US federal contract awards (e.g. \"Lockheed Martin\", \"Booz Allen Hamilton\", \"Palantir Technologies\")."},"max_results":{"type":"integer","default":5,"minimum":1,"maximum":10,"description":"Maximum number of contract awards to return (sorted by award amount descending). Default: 5, max: 10."}}}}}],"endpoint":"https://api.hatchloop.dev/ops/{tool_name}","auth_header":"X-Agent-Identity"}