Start with the decision contract
Traditional APIs often mirror internal resources: projects, crawls, keywords, rows, reports. Agent-facing APIs should begin with the job the model needs to perform. That does not mean hiding the data model. It means giving the model a stable route to useful context.
Examples of task-oriented contracts include:
- Get the latest audit for an authorized project.
- List open opportunities ordered by impact and effort.
- Explore one keyword and return intent, metrics, SERP patterns, and related questions.
- Build a compact workspace pack for planning.
- Compare two audit snapshots and describe material movement.
Each response should let the agent distinguish observed evidence, product-derived scores, and model inference.
Authentication and authorization
Bearer tokens are a practical baseline for custom agents and HTTP clients. The token identifies the account or workspace, but every endpoint still needs project-level authorization. Never trust a project ID simply because it appears in a valid request.
Minimum controls
- Create tokens over an authenticated application session.
- Show the full value only at creation or rotation.
- Store a secure hash or equivalent server-side representation.
- Mask the credential in the UI and logs.
- Allow immediate revocation and deliberate rotation.
- Associate requests with account, workspace, token, client, and project.
- Do not include secrets in query strings.
Design endpoints around retrieval layers
A layered API keeps default responses compact and lets the agent request depth only when needed.
Layer 1: resolve and summarize
GET /projectsGET /projects/{id}/workspaceGET /projects/{id}/freshness
Layer 2: retrieve evidence
GET /projects/{id}/audits/latestGET /projects/{id}/opportunitiesPOST /keywords/explorePOST /competitors/gaps
Layer 3: inspect detail
GET /audits/{audit_id}/issues/{issue_id}GET /opportunities/{opportunity_id}/evidenceGET /keywords/{keyword_id}/serp
SearchSignal’s public API base is presented alongside the MCP package so clients can choose the transport that matches their environment. See the developer docs for the implementation surface.
Build response shapes for reviewability
Every response should answer five questions: what is this, which project and scope does it apply to, how fresh is it, what evidence does it contain, and what limits or omissions matter?
{
"data": {
"project": {"id": "proj_123", "domain": "example.com"},
"audit": {"id": "audit_456", "health": 87},
"opportunities": [
{
"id": "opp_01",
"title": "Repair internal-link gaps",
"impact": 91,
"effort": "low",
"affected_urls": 14,
"evidence_url": "/opportunities/opp_01/evidence"
}
]
},
"meta": {
"generated_at": "2026-07-27T19:15:28Z",
"coverage": "latest completed audit",
"partial": false,
"next_cursor": null
}
}Stable IDs matter. They let the model retrieve detail, compare snapshots, and refer to the same object in later steps without matching on fragile titles.
Keep context compact without hiding evidence
Agent context is limited and expensive. Use summaries, pagination, field selection, and task-specific filters. But do not summarize away the fields needed to verify the conclusion.
- Return the top opportunities by default, with a cursor for the rest.
- Include representative URLs and a link or tool for the full affected set.
- Expose units and data sources for metrics.
- State whether values are observed, estimated, licensed, or derived.
- Use a compact workspace pack for orientation, then narrower endpoints for detail.
The goal is progressive disclosure: enough context to choose the next call, not enough noise to make the next call impossible.
Errors, limits, and partial data are product features
An agent should never have to infer why a result is empty. Use stable error codes and human-readable guidance.
401 invalid_token— token is missing, revoked, or malformed.403 project_forbidden— the token is valid but not authorized for the project.404 project_not_found— the identifier cannot be resolved.409 refresh_in_progress— newer data is being generated.422 invalid_scope— the request arguments are valid JSON but unsupported for the tool.429 rate_limited— return a retry time and remaining limit when appropriate.
Partial success should be explicit. If keyword metrics are available but live backlinks are not, return the supported result with a structured warning rather than silently dropping the missing section.
Freshness, caching, and cost control
Search data has different freshness requirements. Audit results may be reused until a site changes. Search Console can be refreshed on a schedule. SERP or keyword metrics may have provider cost and rate constraints. Backlink indexes have their own update cadence.
Return freshness metadata in the response and design cache keys around project, tool, arguments, provider, location, device, and time window. Let the agent request a refresh only when the task justifies it. “Latest” should mean the latest completed result, not an unbounded promise of real-time data.
Expose the same contract through MCP
MCP tools can wrap the same application service used by the HTTP API. The tool description should explain when to call it, the required project resolution, the freshness behavior, and the shape of the result.
Good tool descriptions reduce unnecessary calls and make the model more likely to retrieve evidence before giving advice. Keep names job-oriented, arguments explicit, and results consistent with the HTTP contract.
Use the SEO MCP server guide for the product architecture and the agentic workflow guide for the operating loop around the API.
Evaluate with real tasks, not endpoint demos
A successful 200 response proves transport, not usefulness. Test complete tasks:
- Resolve the correct project from a domain.
- State freshness and coverage limits.
- Retrieve the latest audit and top opportunities.
- Inspect supporting URLs for one opportunity.
- Create an implementation plan tied to a repository or CMS.
- Recheck the relevant evidence after delivery.
Score whether the agent chose the correct tools, avoided unsupported claims, cited the right evidence, respected permissions, and produced a handoff a practitioner could actually review.
Frequently asked questions
It should return structured evidence with stable field names, freshness timestamps, source and scope information, clear limits, and enough page- or query-level detail to verify recommendations. The response should be compact by default and expandable when the agent requests more detail.
Use MCP when the client supports tool discovery and calling. Use authenticated HTTP when building a custom agent, scheduled workflow, server integration, or client without MCP support. Both can sit on the same underlying service contract.
Store tokens in the client's secret or environment configuration, never in public code or browser analytics. Support rotation and revocation, mask tokens after creation, and enforce authorization at the project boundary on every request.
Use task-oriented endpoints, compact summaries, pagination, field selection, stable IDs, and follow-up tools for detail. Do not return the entire project history when the task only needs one audit issue or keyword group.
Make missing, stale, partial, or unsupported data explicit. Models are more dangerous when a response looks complete but silently omits the limits that should change the recommendation.