assemble_context
Coverage graphGraphRAG as a service: returns a ready-to-read context pack — corroborated, story-deduplicated, trust-ranked and packed to a token budget, each passage carrying the reason it was included.
Instead of a link list, a context set. The engine runs the whole retrieval loop — retrieve, collapse by story, rank by corroboration then authority then relevance, pack to budget — so the agent just reads.
Every item carries its reason, which means the agent can show its work. In production, where a wrong answer has to be explainable, that is not a nicety.
Arguments
| Name | Type | Description |
|---|---|---|
queryrequired | string | The question. |
budget | integer | Token budget. Defaults to 4000. |
lang | string | Language restriction. |
Returns:A context pack: budget, estimated tokens, and items with reasons.
Example
Prompt: “Get me everything I need to answer this question, in 4,000 tokens.”
{ "query": "who funds independent web indexes", "budget": 4000 }Over HTTP
The same operation is available as GET /assemble_context for anything that does not speak MCP.
curl -H "x-api-key: $UNLOB_API_KEY" \
"https://api.unlob.com/assemble_context?q=who+funds+independent+web+indexes&budget=4000"Setup
One config block gives your client all 11 tools, including this one.
{
"mcpServers": {
"unlob": {
"command": "npx",
"args": ["-y", "@unlob/mcp"],
"env": { "UNLOB_API_KEY": "ulb_your_key_here" }
}
}
}Get a key and connect
10,000 free requests a month. MCP calls bill exactly like HTTP calls — one request each.