unlob Docs
Browse documentation

get_document: full text of one passage

Fetch the full cleaned text of a passage by its id (from a web_search hit), with its metadata.

Behaviour

Snippets in search results are the passage text, so most questions need no call here. Reach for it when you need the whole document rather than the matching passage.

Costs 1 credit.

Arguments

inputSchema

NameTypeDescription
idrequiredstringPassage id from a hit
riskbooleanAlso return risk_flags for the text: instruction_like, hidden_text, role_markers, low_trust_source
stripbooleanRemove instruction-like sentences from the text (each becomes '[removed: instruction-like text]'). Implies risk.

Returns

A JSON payload in the text content block, and the same payload as structuredContent for clients that support it.

outputSchema

NameTypeDescription
hostrequiredstring—
host_rankrequirednumber—
idrequiredstring—
langrequiredstring—
qualityrequiredinteger—
risk_flags"instruction_like" | "hidden_text" | "role_markers" | "low_trust_source"[]Present when risk or strip was set. Computed on the original text.
sentences_removedintegerPresent when strip was set: how many sentences were removed
textrequiredstringThe full cleaned body
titlerequiredstring—
urlrequiredstring—
verticalrequiredstring—

Calling it

Over Streamable HTTP, with the required arguments filled in:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_document",
    "arguments": {
      "id": "<id>"
    }
  }
}

Most clients do this for you — see Connect a client. To drive it by hand, complete the startup lifecycle first.

The same call over REST

If your client does not speak MCP, this capability is GET /doc/{id}, taking the same parameters and returning the same body.

curl -H "x-api-key: $UNLOB_API_KEY" \
  "https://api.unlob.com/doc/<id>"