Skip to main content
To give an AI agent company search, define one tool that takes a plain-language description and calls the Semantic Company Search API. The agent describes the companies it wants, and the API returns full company records that the agent can use in its next steps without a second lookup. A semantic search costs 2 credits per company returned. There are three ways to connect an agent. This page covers the second.

Define the tool

A tool has a name, a description the model reads to decide when to call it, and a JSON Schema for its input. This definition takes a description of the companies, two optional exact filters, and a limit.
Model providers name the outer fields differently, so adapt parameters to the key your provider uses for the input schema. Put the cost in the tool description, as this one does, so the model can weigh it before it calls the tool.

Write the handler

The handler turns the tool input into a search. It counts the matches first, which is free, then fetches one page and returns a short version of each company to the model.
Register the definition with your model provider, and call the handler when the model uses the tool. The handler returns this to the model. The example is shortened and shows a fictional company.
interpretation reports what the API read from the description, such as a location or a size. Passing it to the model lets the agent see how its words were understood and rephrase when the reading is wrong.

Send the same request yourself

Before you connect the tool, send the request it makes and look at the full response. This is the search the handler runs for the call above.
Each item in the response is a full company record, so the agent does not need to enrich the companies it finds. The handler above returns seven fields from each record to keep the model’s context small. Return more fields when your agent needs them.

Keep the agent’s spending in check

An agent decides for itself when to call a tool, so set the limits in the handler and not in the prompt.
  • Count before you search. The count endpoint is free and takes the same query. A search that returns nothing still costs 2 credits, and the count catches it first.
  • Cap the page size. You pay for every company on a page. The handler above allows at most 25, which is at most 50 credits per call.
  • Return one page per call. Do not follow nextCursor automatically. If the agent needs more, let it ask again.
  • Add expansions only when needed. Each value in expand, such as technologies or financial, adds 1 credit per company.
  • Watch the balance. GET /v2/me is free and returns the credits used and the total allowance.

Common questions

Does the agent need to enrich the companies it finds?

No. A search returns full company records with the name, domain, description, industry, size, revenue range, location, and social profiles. Enrich a company only to add an expansion you did not request in the search. See Company Enrichment API.

What does one tool call cost?

2 credits for each company returned, so 20 credits for 10 companies. The count that runs first is free.

Why did the search apply a filter the agent did not send?

By default, the API reads a location, a size, a founding year, or funding from the description and applies it as a filter. The interpretation in the response shows what it applied. A filter the tool sends takes precedence over an inferred value of the same kind, and semantic.autoFilter set to false turns the inference off.

Should the tool use semantic search or filters?

Semantic search fits an agent that starts from a description. When the agent already has exact criteria, such as a country, a size range, and a technology, a filter search costs 1 credit per company. The two work together in one request.

Can the agent search for people in the same way?

Yes. People search has its own semantic mode. See Describe who you want.

MCP server

Connect Claude, Codex, Cursor, and other MCP clients with no code.

Semantic Company Search API

How a description is interpreted, ranked, and priced.

Find companies in a niche from a description

Check a description for free, then narrow it with filters.

Credits

What each search and expansion costs.