What agents need from a data provider
If you build agents for sales, recruiting, research or customer success, sooner or later the agent needs facts about real people and companies: who runs marketing at this account, what is this person's work email, how many employees does this company have. Hard-coding a scraper is brittle. Wiring a traditional data provider into a tool call usually works for a demo and then breaks down in production, for reasons that have little to do with data quality.
Agents call tools in loops, retry on failure, misread instructions and occasionally decide to do far more work than you intended. A data API that bills per call, with no budget visibility and opaque errors, turns each of those behaviours into a cost or reliability problem. What agents need is a tool surface that tells the model what each call costs, lets it check its budget, enforces ceilings on the server side and returns errors the model can act on.
The failure modes worth designing for
Four patterns come up repeatedly. Runaway loops: the agent paginates through 40 pages of search results because the stopping condition was vague. Silent retries: a timeout leads to a resubmit, and the same expensive lookup is billed twice. Wrong tool choice: the agent enriches a full profile when it only needed an email. Unrecoverable errors: a 4xx with a terse message, which the model either ignores or retries forever.
Prompting helps but is not a control. The reliable fixes live in the API: hard ceilings per request, per key and per account; quotes that cost nothing; idempotency keys; and error payloads that say what to do next. Dizo provides each of these, and the rest of this page shows how to put them into an agent's tool loop.
Connecting over MCP
The Dizo MCP server lives at https://mcp.dizo.ai/mcp and uses streamable HTTP. Clients that support OAuth 2.1 send the user through sign-in; otherwise pass Authorization: Bearer with a Dizo key. For Claude Code, the command is claude mcp add --transport http dizo https://mcp.dizo.ai/mcp --header "Authorization: Bearer $DIZO_API_KEY". Clients that use a JSON config, such as Cursor's .cursor/mcp.json, take a url and headers entry. For a local process, npx -y @dizo/mcp runs a stdio server that reads DIZO_API_KEY.
If you are building on an agent framework, check the framework's own docs for how it consumes remote MCP servers, then point it at the same URL. The Claude Agent SDK, OpenAI Agents SDK and LangChain integration pages cover the setup. Discovery files are published too: /.well-known/mcp.json for the manifest, llms.txt and llms-full.txt for docs, and openapi.json for the OpenAPI 3.1 spec.
A tool surface the model can reason about
Every Dizo API is exposed as a tool, and each description includes its credit cost: dizo_find_email says 1 credit if found, dizo_find_phone says 10 credits if found, search tools say 1 credit per 25 results. That gives the model the information it needs to pick the cheaper path, for example calling the email finder rather than a full person enrich when only an address is required.
Dizo also publishes routing guidance for agents: plain-English dizo_search for open-ended prospecting, dizo_best_contact for the right person at each of many accounts, dizo_org_chart for who runs a department, dizo_count for sizing before searching, and dizo_batch for more than 50 lookups. Putting a short version of that table in your system prompt gives the model a clear default for each kind of request.
The budget loop
Teach the agent a fixed sequence. At start-up, call dizo_whoami (GET /v1/me), which returns the key's scopes, allowed endpoints, max_credits_per_request and remaining daily and monthly credits. Plan within those numbers. Before any job that could exceed about 100 credits, call dizo_quote or send the request with dry_run: true for an exact cost that spends nothing, and ask the human if the quote is large.
On every billable call, send max_credits as a hard ceiling for that request. Read x-dizo-credits-used and x-dizo-credits-remaining from each response and keep a running tally in the agent's state. Before long loops, check dizo_balance and stop to ask if monthly spend is near the cap. Billing write actions, such as top-ups or refill changes, require a key with billing:write and explicit human approval, so leave that scope off agent keys entirely.
Composing tools within one task
Most useful agent tasks chain two or three tools. A typical prospecting task runs dizo_count to size the request for free, then dizo_search with include: ["email"] so validated emails arrive in the same call, charged only for addresses found, then dizo_find_phone only for the few people who need a call. An account task runs dizo_domain_to_company, then dizo_org_chart with a department filter, then dizo_best_contact when it needs a single named person.
Keep intermediate results in the agent's state rather than calling the same tool twice. Dizo ids from one tool, such as a person_id from search, can be passed straight to the email finder, phone finder or person enrich, which avoids a second identity match. When a single task would mean more than 50 lookups, hand the list to dizo_batch and wait for completion instead of looping.
Errors, retries and idempotency
Dizo errors include a stable error.code, a plain-English error.fix, a retryable boolean and, where relevant, retry_after in seconds. Return the whole error object to the model as the tool result. A fix such as narrowing the query or lowering the limit gives the model something concrete to act on, where a bare status code leaves it guessing.
Retry only when retryable is true, after the stated delay, and cap the number of retries in your orchestration code rather than leaving it to the model. Send an Idempotency-Key header on every POST; retries within 24 hours are never charged twice. When a cap is hit, calls return 402 with codes such as monthly_cap_reached, which your agent should treat as a hard stop and escalate.
Keys and guardrails per agent
Create a dedicated key for each agent or environment with POST /v1/keys. Set scopes to data:read, a daily_cap_credits and monthly_cap_credits that match what the agent should ever spend, a max_credits_per_request, and allowed_endpoints containing only the tools it needs. An SDR agent might get search, best-match and the email finder, and no phone finder at all.
MCP connections default to data:read and a 500-credit per-call limit, which you can change in the console. At the account level, set a monthly cap in dollars and lock billing so no key can change it. Alerts go out by email and webhook at 50, 80 and 100 percent of any cap, which gives you a chance to look before an agent stops.
Testing and evaluation
Keys that start with dz_test_ return synthetic data and never spend credits, which makes them suitable for unit tests, evaluation suites and CI runs. Build a set of tasks, such as find the VP Sales at these 10 domains with emails, and score the agent on tool choice, number of calls, credits that would have been used, and correct handling of not-found responses.
A useful evaluation metric is credits per successful task, measured on test keys by summing the quoted cost of each call. Regressions in that number often reveal prompt changes that made the agent wander. Also test failure paths deliberately: a key with a tiny cap, an endpoint missing from the allow-list, a malformed request. The agent should read the error, follow the fix or stop, and never loop.
What an agent costs to run
Take a hypothetical research agent that prepares account briefs. Each run calls domain to company for 1 credit, the org chart for one department returning 25 people for 1 credit, and the decision-maker finder for one person with an email, about 1.04 credits. A brief costs about 3.04 credits. At 2,000 briefs a month, that is about 6,080 credits, or roughly $128 bought at the Builder rate of $0.021.
An outbound agent that finds 1,000 prospects a month through search, at 40 credits, and verified emails for 750 of them, at 750 credits, uses 790 credits, about $20 at the pay-as-you-go rate. Set the agent key's monthly cap a little above the expected number. Sign up for live keys, and see the AI SDR agents use case for a full build.
Frequently asked questions
Which MCP transport does Dizo use?
Streamable HTTP at https://mcp.dizo.ai/mcp, with OAuth 2.1 or a bearer key. A local stdio server is also available with npx -y @dizo/mcp.
How does the agent know what a tool costs?
Every tool description includes its credit cost. The agent can also call dizo_quote, or send any request with dry_run: true, for an exact cost that spends nothing.
Can an agent top up my account?
Only with a key that has the billing:write scope, and Dizo's agent rules require explicit human approval. Keys are read-only for billing by default, and the owner can lock billing entirely.
What stops an agent from overspending?
Per-request max_credits, per-key daily and monthly caps, the 500-credit default per MCP call, and the account's monthly USD cap. When a cap is hit, calls return a 402.
How should the agent handle errors?
Pass the error object back to the model. Branch on error.code, follow error.fix, and retry only when retryable is true after retry_after seconds.
Can I run evals without spending credits?
Yes. dz_test_ keys return synthetic data and never spend credits, so you can run test suites and CI against the same endpoints.
Last reviewed 2026-11-24.