# Resolve
Source: https://stackresolve.dev/docs/resolve

> Turn a task into ranked products that expose the capabilities it needs.


`resolve` is the call to make when an agent has a job to do and no opinion about which tool
does it. It reads the task, works out which capabilities the job actually needs, then returns
products that expose those capabilities, ranked by how many they cover and by their
[AgentReady Score](/methodology). Every result carries a reason, so the agent can explain its
choice instead of asserting one.

The difference from [find_tools_for_task](/find-tools) is the capability graph. `find_tools_for_task`
searches the registry for terms. `resolve` maps the task onto a controlled vocabulary of
capabilities first, so "log my API errors" becomes `capture_errors`, `collect_logs`,
`ship_logs` and `trace_requests`, and a product that only ships logs ranks below one that
also captures errors.

## Call it

<CodeGroup>
```bash REST
curl https://api.stackresolve.dev/v1/resolve \
  -H "x-api-key: $STACKRESOLVE_API_KEY" \
  -H "content-type: application/json" \
  -d '{"task": "log my API errors", "requirements": {"mcp": true}}'
```

```text MCP
resolve({ task: "log my API errors", mcp: true })
```

```bash CLI
stackresolve resolve "log my API errors"
```
</CodeGroup>

<ParamField body="task" type="string" required>
  The job to be done, in plain language. Describe the outcome, not a product category.
</ParamField>
<ParamField body="requirements" type="object">
  Hard filters over `api`, `mcp`, `self_serve`, `openapi`, `cli`. A product that lacks one is
  dropped, not ranked lower. On REST, nest them under `requirements`. On MCP, pass them as
  flat booleans on the tool input.
</ParamField>
<ParamField body="discover" type="boolean" default="false">
  Search the web and audit new products into the registry when registry coverage is thin.
  Slower and more expensive. Leave it off unless a first call came back short.
</ParamField>

```json Response
{
  "task": "log my API errors",
  "capabilities": ["capture_errors", "collect_logs", "ship_logs", "trace_requests"],
  "requirements": { "mcp": true },
  "results": [
    {
      "slug": "betterstack",
      "name": "Better Stack",
      "domain": "betterstack.com",
      "agentready": 52,
      "matched": ["capture_errors", "ship_logs", "trace_requests"],
      "capScore": 15,
      "reason": "Exposes Capture errors, Ship and search logs, Trace requests; AgentReady 52; meets mcp"
    }
  ],
  "discovered": 0
}
```

<ResponseField name="capabilities" type="string[]">
  The capabilities the task was resolved to. Read these back to the user when the ranking
  looks wrong: a bad answer here usually means the task was described as a category rather
  than an outcome.
</ResponseField>
<ResponseField name="results" type="array">
  Ranked candidates. `matched` lists which of the resolved capabilities the product exposes,
  `capScore` weights coverage, and `reason` is a sentence the agent can quote.
</ResponseField>
<ResponseField name="discovered" type="number">
  How many products were audited into the registry during this call. Always `0` unless
  `discover` was set.
</ResponseField>

<Note>Metered as `agent_discovery_check`. Setting `discover: true` also bills the audits it
runs.</Note>

<Tip>Ranking a shortlist you already have is [compare_products](/primitives/compare).
Working out how to build the thing once the tool is chosen is [how_to](/how-to).</Tip>

