Setup prompt
Instructions for the agent
Follow these steps in order. Ask the user before any step that spends credits.1
Get the credentials from the user
You can’t create a Forager account or API key yourself. Ask the user to:
- Sign up at app.forager.ai, or sign in.
- Create a key on the API page.
- Copy the Account ID from My Account.
- Store them as
FORAGER_API_KEYandFORAGER_ACCOUNT_IDin the project’s existing secrets setup, such as.env(gitignored) or the platform’s secret store. - Never write the key into source files, logs, prompts or client-side code.
2
Learn the API
- Read the Forager API skill: endpoints, auth, costs and a pre-flight checklist.
- Use Choose the right endpoint to map what the user has to the endpoint they need.
- The full spec is openapi.yaml, and every page is available as Markdown by adding
.mdto its URL.
- Server
https://api-v2.forager.ai. - Send the key in the
X-API-KEYheader. - Most paths include
{account_id}.
3
Write a small server-side client
Follow the project’s existing conventions for HTTP calls, configuration and errors. The client should:
- Read
FORAGER_API_KEYandFORAGER_ACCOUNT_IDfrom the environment. - Send JSON bodies with
Content-Type: application/json. - Treat
403as a credentials problem and surface it clearly. - Back off and retry on
429, as described in API errors and rate limits. - Handle an empty result as “not found”, not as an error.
4
Check the cost, then test one call
Most lookups spend credits; see credits and pricing. A phone number lookup costs 15 credits per lookup.
- Tell the user what a test call costs and get a yes before you send it.
- Prefer one request with a known LinkedIn public identifier the user gives you.
- Never loop over real data during setup.
5
Add tests and document the setup
- Add tests that mock the HTTP layer. Tests must not call the live API or spend credits.
- Document the two environment variables and how to try the integration.
Rules for agents
- Don’t guess credit costs, endpoints or field names. Use credit pricing and the API reference.
- Don’t call the API from browser code; the key would be exposed.
- Report bad data with the feedback endpoints instead of retrying the same lookup.
- The docs MCP server at
/mcpsearches these docs only. It does not call the Forager API.