Make your first call

Create a key, list the tools, then run a search against the connector with curl.

How-toDeveloperChecked 2026-10-10

By the end you will have listed the connector's tools and run one search. The connector speaks MCP over streamable HTTP, which is JSON-RPC in a POST.

Before you start

  • An Adapt Leads account and a key. See Keys, sign-in and permissions. The default key is enough for this page.
  • curl. Put the key in a variable so it does not end up in your shell history: export ADL_KEY=adl_your_key.

Steps

  1. Check the address answers. A request with no key gets a clear refusal:

    curl -i -X POST https://mcp.adaptleads.co.uk/ \ -H 'Content-Type: application/json' \ -H 'Accept: application/json, text/event-stream' \ -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

    You should see HTTP/2 401 and this body:

    {"error":"unauthorized","detail":"Provide an AdaptLeads access token as a bearer token. Create one in the web app under Settings."}

  2. List the tools your key can see. Add the header Authorization: Bearer $ADL_KEY to the same call:

    curl -X POST https://mcp.adaptleads.co.uk/ \ -H "Authorization: Bearer $ADL_KEY" \ -H 'Content-Type: application/json' \ -H 'Accept: application/json, text/event-stream' \ -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

    The connector is stateless, so there is no session to open first. Replies can arrive as a server-sent event (event: message then data: {...}), so read the line that starts data:. The list holds every tool the connector has, not only those your key may call. See MCP connector tools.

  3. Run a search:

    curl -X POST https://mcp.adaptleads.co.uk/ \ -H "Authorization: Bearer $ADL_KEY" \ -H 'Content-Type: application/json' \ -H 'Accept: application/json, text/event-stream' \ -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"search_leads","arguments":{"sector":"accountants","area":"Sheffield","has_website":true,"page_size":2}}}'

  4. Read the answer. The tool result is a text block holding JSON. Inside it, a sample trimmed to the useful fields:

    { "total": 412, "page": 1, "page_size": 2, "results": [ { "lead_id": "mkt_sample0001", "name": "Marsh and Keel Accountants", "locality": "Sheffield", "postcode_out": "S1", "website_domain": "marshandkeel.example", "availability": {"has_phone": true, "has_email": true, "has_website": true, "has_socials": false}, "revealed": false } ], "widened": null, "did_you_mean": [] }

    Names, towns and the outward postcode are shown. Emails and phone numbers are not. Ask for one record with lead_detail and pass its lead_id.

What happens next

If something goes wrong

  • 401 after you added the key: check there is no stray quote or space, and that the key has not been revoked or expired.
  • 403 with "no longer has access": the account is not on the approved sign-in list.
  • 406 or an empty reply: the Accept header must list both application/json and text/event-stream.
  • {"error":"sector_not_recognised", ...}: the word is not one of the book's categories. Call resolve_sector for the closest ones. This is not a statement that no such businesses exist.