document_text
Pack: folketinget-dk · Connect: https://pipeworx.io/mcp (see Connect below for a single-pack URL)
No MCP client? Call it directly: GET https://gateway.pipeworx.io/v1/tools/document_text for the schema, then POST the same URL with its arguments for the data.
Return the full TEXT of a Folketinget (Danish Parliament) document by its numeric Dokument id — e.g. a minister’s final answer to a committee question (udvalgsspørgsmål), a bill text, a consultation reply. Resolves the Dokument record, fetches its published file and extracts the text (PDF or Word; the declared file format is not trusted, the bytes are sniffed). Returns title, date, the question wording (spørgsmålsordlyd), who answered/asked, the extracted text, and a reason when no text could be read (file missing, scanned image, unsupported type) so an empty text is never ambiguous. Long texts are paged with offset/max_chars. Source: Folketinget, parliamentary document register.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
document_id | number | yes | Numeric Dokument id, e.g. 1237262 (the id used by get_entity_by_id with entity “Dokument”). |
max_chars | number | no | Max characters of text to return (default 100000, max 400000). |
offset | number | no | Character offset into the extracted text, for paging a long document (default 0). |
Example call
Arguments
{
"document_id": 1237262
}
curl
curl -X POST https://gateway.pipeworx.io/folketinget-dk/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"document_text","arguments":{"document_id":1237262}}}'
TypeScript (@pipeworx/sdk)
import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();
const result = await pipeworx.call('document_text', {
"document_id": 1237262
});
More examples
{
"document_id": 1236625,
"max_chars": 20000
}
Response shape
| Field | Type | Description |
|---|---|---|
found | boolean | False when no document has that id |
document_id | number | |
title | string | null | |
date | string | null | |
type_id | number | null | |
question_wording | string | null | Danish wording of the parliamentary question, when the document answers one |
question_title | string | null | |
question_id | number | null | |
answered_by | string | null | |
actors | array | |
data_as_of | string | null | |
source | string | |
file | object | |
text | string | null | Extracted document text; null when reason is set |
text_chars_total | number | |
offset | number | |
returned_chars | number | |
truncated | boolean | |
next_offset | number | null | |
reason | string | Why no text was returned (document_not_found, no_file, file_fetch_failed, file_blocked, no_extractable_text, unsupported_file_type, …) |
message | string | |
warnings | array |
Full JSON Schema
{
"type": "object",
"properties": {
"found": {
"type": "boolean",
"description": "False when no document has that id"
},
"document_id": {
"type": "number"
},
"title": {
"type": [
"string",
"null"
]
},
"date": {
"type": [
"string",
"null"
]
},
"type_id": {
"type": [
"number",
"null"
]
},
"question_wording": {
"type": [
"string",
"null"
],
"description": "Danish wording of the parliamentary question, when the document answers one"
},
"question_title": {
"type": [
"string",
"null"
]
},
"question_id": {
"type": [
"number",
"null"
]
},
"answered_by": {
"type": [
"string",
"null"
]
},
"actors": {
"type": "array",
"items": {
"type": "object",
"properties": {
"role": {
"type": [
"string",
"null"
]
},
"name": {
"type": [
"string",
"null"
]
}
},
"additionalProperties": true
}
},
"data_as_of": {
"type": [
"string",
"null"
]
},
"source": {
"type": "string"
},
"file": {
"type": "object",
"properties": {
"title": {
"type": [
"string",
"null"
]
},
"declared_format": {
"type": [
"string",
"null"
]
},
"detected_format": {
"type": "string"
},
"bytes": {
"type": "number"
},
"pages": {
"type": [
"number",
"null"
]
}
},
"additionalProperties": true
},
"text": {
"type": [
"string",
"null"
],
"description": "Extracted document text; null when reason is set"
},
"text_chars_total": {
"type": "number"
},
"offset": {
"type": "number"
},
"returned_chars": {
"type": "number"
},
"truncated": {
"type": "boolean"
},
"next_offset": {
"type": [
"number",
"null"
]
},
"reason": {
"type": "string",
"description": "Why no text was returned (document_not_found, no_file, file_fetch_failed, file_blocked, no_extractable_text, unsupported_file_type, ...)"
},
"message": {
"type": "string"
},
"warnings": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": true
}
Connect
Add this to your MCP client config — every tool in the catalog, including this one — or use one-click install buttons:
{
"mcpServers": {
"pipeworx": {
"url": "https://pipeworx.io/mcp"
}
}
}
Connect to just the folketinget-dk pack
{
"mcpServers": {
"folketinget-dk": {
"url": "https://gateway.pipeworx.io/folketinget-dk/mcp"
}
}
}
See Getting Started for client-specific install steps.