API & MCP

Everything a person can do on RAG Citation Debugger, a program or AI agent can do with the same inputs and get the identical result.

HTTP API

RAG Citation Debugger

Paste a generated answer with citation markers ([1], [doc2], [^3], ^1, 【4】) and the retrieved chunks. Each sentence is mapped to the chunks it cites and checked for lexical support: uncited claims, citations to chunks that do not support the sentence, numbers that are not in the cited chunk, better-matching chunks, markers pointing to non-existent chunks, and retrieved chunks that were never used.

Inputs of RAG Citation Debugger
FieldTypeDefaultDescription
answer (required)textarea—Generated answer with citation markers
chunks (required)textarea—Retrieved chunks. JSON [{"id":"doc1","text":"…"}] or one chunk per block starting with [id] or id: …
supportThresholdnumber0.5Support threshold. Share of the sentence's content words that must appear in a cited chunk.

Example request

Answer with a wrong number, a misattributed citation and an uncited claim

curl -X POST https://ragcitationdebugger.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"answer":"The Eiffel Tower is 330 metres tall [1]. It was completed in 1888 for the World's Fair [2]. It was designed by the engineering company of Gustave Eiffel [3]. Around 7 million people visit it every year.","chunks":"[{\"id\":\"1\",\"text\":\"The Eiffel Tower is a wrought-iron lattice tower in Paris. It is 330 metres (1,083 ft) tall, about the same height as an 81-storey building.\"},{\"id\":\"2\",\"text\":\"Construction of the tower began in 1887 and it was completed in 1889 as the centrepiece of the 1889 World's Fair (Exposition Universelle).\"},{\"id\":\"3\",\"text\":\"Paris has a population of about 2.1 million inhabitants and is the capital of France.\"},{\"id\":\"4\",\"text\":\"The tower is named after the engineer Gustave Eiffel, whose company designed and built the tower.\"},{\"id\":\"5\",\"text\":\"The Louvre is the world's most-visited museum.\"}]"}'

Every result contains

inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.

MCP (Model Context Protocol)

{
  "mcpServers": {
    "rag-citation-debugger": { "type": "http", "url": "https://ragcitationdebugger.usefulweb.site/mcp" }
  }
}