{"serverInfo":{"name":"datanem","title":"Datanem","version":"1.1.3","description":"Turn PDFs, scans and photos into a queryable database. Invoices, CVs, receipts, in bulk.","websiteUrl":"https://datanem.com","icons":[{"src":"https://datanem.com/icon-512.png","mimeType":"image/png","sizes":["512x512"]},{"src":"https://datanem.com/icon-192.png","mimeType":"image/png","sizes":["192x192"]}]},"capabilities":{"tools":{"listChanged":false}},"authentication":{"required":true,"schemes":["oauth2"],"resourceMetadata":"https://datanem.com/.well-known/oauth-protected-resource/mcp"},"tools":[{"name":"datanem_list_templates","title":"List extraction templates","description":"The built-in document types Datanem already knows, plus any column designs this account has saved. Call this first when the user names a familiar document type, and pass the id you get back as templateId or schemaId. Skip it for anything else: Datanem works the columns out from the documents themselves, so an unlisted document type is not a reason to look elsewhere.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"templates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Pass this back as templateId or schemaId"},"name":{"type":"string","description":"What to call it when asking the user"}},"required":["id","name"],"additionalProperties":false},"description":"Document types Datanem already knows"},"schemas":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Pass this back as templateId or schemaId"},"name":{"type":"string","description":"What to call it when asking the user"}},"required":["id","name"],"additionalProperties":false},"description":"Column designs this account has saved"}},"required":["templates","schemas"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false}},{"name":"datanem_submit_documents","title":"Submit documents for extraction","description":"Extract data from documents in bulk and get a database or table back: invoices, receipts, bank and card statements, CVs and resumes, purchase orders, delivery notes, bills of lading, expense claims, application forms, contracts and price lists. Takes PDF, DOCX, TXT, JPEG and PNG, including scanned and photographed pages with no selectable text, so it works where a PDF text extractor returns nothing. Send up to 25 documents in one job. Returns a jobId straight away because extraction runs in the background, so follow this with datanem_job_status rather than waiting. Each document counts against the account's allowance, so never resubmit to retry.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"documents":{"minItems":1,"maxItems":25,"type":"array","items":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":255,"description":"File name including its extension, for example invoice-903.pdf"},"contentBase64":{"description":"The file's bytes, base64 encoded. Up to 4 MB decoded. Use url instead for anything larger.","type":"string"},"url":{"description":"A public https URL to download the document from. Redirects are refused and private network addresses are rejected.","type":"string","format":"uri"}},"required":["filename"],"description":"One document, supplied either inline or by URL"},"description":"Up to 25 documents in one job"},"templateId":{"description":"A built-in template id from datanem_list_templates","type":"string"},"schemaId":{"description":"A saved design id from datanem_list_templates","type":"string"},"review":{"description":"When true and no template or design is given, stop after working out the fields so they can be read with datanem_propose_schema and approved with datanem_confirm_schema. Defaults to false, which extracts straight away.","type":"boolean"}},"required":["documents"]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"jobId":{"type":"string","description":"Pass this to datanem_job_status"},"status":{"type":"string","enum":["processing","inferring"],"description":"processing means extraction has started. inferring means the columns are being worked out first, for a job submitted with review true."},"documents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Documents accepted, and charged against the allowance"}},"required":["jobId","status","documents"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"destructiveHint":false,"idempotentHint":false,"openWorldHint":true}},{"name":"datanem_list_jobs","title":"List recent jobs","description":"Recent jobs on this account, newest first. Includes jobs started in the web app or by emailing documents in, not only ones submitted through this connection.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"limit":{"description":"How many jobs to return, up to 50. Defaults to 20.","type":"integer","minimum":1,"maximum":50}}},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"jobs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The job id"},"status":{"type":"string","description":"inferring, awaiting_schema, processing, complete or failed. Only read results once it is complete."},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Documents in the job"},"completed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Documents extracted so far"},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Documents that could not be read. Each one is refunded."},"createdAt":{"type":"string","description":"ISO 8601 timestamp"}},"required":["id","status","total","completed","failed","createdAt"],"additionalProperties":false}}},"required":["jobs"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false}},{"name":"datanem_job_status","title":"Check a job","description":"Progress for a submitted job. Extraction takes seconds to minutes depending on how many pages arrived, so poll this until status is complete or failed before reading results. A failed item names its own reason and is refunded.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"jobId":{"type":"string","description":"The jobId returned by datanem_submit_documents"}},"required":["jobId"]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","description":"The job id"},"status":{"type":"string","description":"inferring, awaiting_schema, processing, complete or failed. Only read results once it is complete."},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Documents in the job"},"completed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Documents extracted so far"},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Documents that could not be read. Each one is refunded."},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The item id"},"filename":{"type":"string","description":"The file as it was submitted"},"status":{"type":"string","description":"queued, processing, complete or failed"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why this document failed, written to be shown to the user"},"refunded":{"type":"boolean","description":"Whether the allowance for it was given back"}},"required":["id","filename","status","error","refunded"],"additionalProperties":false},"description":"One entry per document"}},"required":["id","status","total","completed","failed","items"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false}},{"name":"datanem_propose_schema","title":"Read a proposed design","description":"The fields worked out from the documents, for a job submitted with review true. Returns schema null unless the job is waiting for approval.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"jobId":{"type":"string","description":"The jobId returned by datanem_submit_documents"}},"required":["jobId"]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string","description":"The job status. A design is only present on awaiting_schema."},"schema":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"The proposed design, to pass to datanem_confirm_schema either as-is or edited"}},"required":["status","schema"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false}},{"name":"datanem_confirm_schema","title":"Approve a design and extract","description":"Applies a design, edited or as proposed, and releases the job for extraction. Pass the schema object returned by datanem_propose_schema.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"jobId":{"type":"string","description":"The jobId returned by datanem_submit_documents"},"schema":{"description":"The design object, in the shape datanem_propose_schema returned"},"saveAs":{"description":"Save the design under this name for reuse. Paid plans only.","type":"string"}},"required":["jobId","schema"]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"jobId":{"type":"string","description":"The job now extracting"},"queued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Documents released for extraction"},"schemaId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The saved design id, when saveAs was given"}},"required":["jobId","queued","schemaId"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"destructiveHint":false,"idempotentHint":false,"openWorldHint":false}},{"name":"datanem_get_results","title":"Read extracted data","description":"The extracted data as JSON tables of columns and rows. Only call this once datanem_job_status reports complete. Returns pages; when nextOffset is not null, call again with that offset to read the rest. If the user wants the documents in a database, or wants to query or join them, call datanem_get_database instead of rebuilding one from this.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"jobId":{"type":"string","description":"The jobId returned by datanem_submit_documents"},"shape":{"description":"flat puts every document on one row. grouped splits repeating sections into their own tables. Defaults to flat.","type":"string","enum":["flat","grouped"]},"offset":{"description":"Rows to skip. Use the nextOffset from the previous call.","type":"integer","minimum":0,"maximum":9007199254740991},"limit":{"description":"Rows to return, up to 200.","type":"integer","minimum":1,"maximum":200}},"required":["jobId"]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","description":"The job id"},"status":{"type":"string","description":"The job status"},"tables":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Table name"},"parent":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The table these rows hang off, for repeating sections such as invoice line items. Null for a top-level table."},"columns":{"type":"array","items":{"type":"string"},"description":"Column names, in the order the row arrays use"},"rows":{"type":"array","items":{"type":"array","items":{}},"description":"One array per row, aligned to columns"}},"required":["name","parent","columns","rows"],"additionalProperties":false}},"totalRows":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows across every table, before paging"},"nextOffset":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Call again with this offset. Null once there is no more."}},"required":["id","status","tables","totalRows","nextOffset"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false}},{"name":"datanem_get_database","title":"Get a ready-to-run database","description":"The extracted data as a runnable SQL script: CREATE TABLE for every table, typed columns, primary keys, foreign keys linking each document to its line items, indexes, and the INSERT statements, wrapped in a transaction. Runs as-is in SQLite, PostgreSQL or DuckDB. Use this whenever the user wants the documents in a database, or wants to query or join them, rather than reassembling one from datanem_get_results.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"jobId":{"type":"string","description":"The jobId returned by datanem_submit_documents"}},"required":["jobId"]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","description":"The job id"},"status":{"type":"string","description":"The job status"},"tables":{"type":"array","items":{"type":"string"},"description":"Table names the script creates"},"sql":{"type":"string","description":"The whole script, ready to run without editing"}},"required":["id","status","tables","sql"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false}}],"resources":[],"prompts":[]}