naftiko: 1.0.0-alpha2 info: label: Mathpix Document OCR API — Documents description: 'Mathpix Document OCR API — Documents. Submit, monitor, stream, retrieve, and delete PDF/document OCR jobs. Self-contained Naftiko capability covering one Mathpix business surface.' tags: - Mathpix - OCR - PDF - Documents created: '2026-05-25' modified: '2026-05-25' binds: - namespace: env keys: MATHPIX_APP_ID: MATHPIX_APP_ID MATHPIX_APP_KEY: MATHPIX_APP_KEY capability: consumes: - type: http namespace: document-ocr-documents baseUri: https://api.mathpix.com description: Mathpix Document OCR API — Documents business capability. resources: - name: v3-pdf path: /v3/pdf operations: - name: processdocument method: POST description: Process A Document outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object required: true - name: v3-pdf-item path: /v3/pdf/{pdf_id} operations: - name: getdocumentstatus method: GET description: Get Document Status outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: pdf_id in: path type: string required: true - name: deletedocument method: DELETE description: Delete Document inputParameters: - name: pdf_id in: path type: string required: true - name: v3-pdf-mmd path: /v3/pdf/{pdf_id}.mmd operations: - name: downloadmmd method: GET description: Download Mathpix Markdown outputRawFormat: text inputParameters: - name: pdf_id in: path type: string required: true - name: v3-pdf-docx path: /v3/pdf/{pdf_id}.docx operations: - name: downloaddocx method: GET description: Download DOCX outputRawFormat: binary inputParameters: - name: pdf_id in: path type: string required: true - name: v3-pdf-tex-zip path: /v3/pdf/{pdf_id}.tex.zip operations: - name: downloadtexzip method: GET description: Download LaTeX Archive outputRawFormat: binary inputParameters: - name: pdf_id in: path type: string required: true authentication: type: apikey key: app_key value: '{{env.MATHPIX_APP_KEY}}' placement: header additionalHeaders: app_id: '{{env.MATHPIX_APP_ID}}' exposes: - type: rest namespace: document-ocr-documents-rest port: 8080 description: REST adapter for Mathpix Document OCR API — Documents. resources: - path: /v1/v3/pdf name: v3-pdf operations: - method: POST name: processdocument description: Process A Document call: document-ocr-documents.processdocument with: body: rest.body outputParameters: - type: object mapping: $. - type: mcp namespace: document-ocr-documents-mcp port: 9090 transport: http description: MCP adapter for Mathpix Document OCR API — Documents. tools: - name: mathpix-process-document description: Process A Document hints: readOnly: false destructive: false idempotent: false call: document-ocr-documents.processdocument with: body: tools.body outputParameters: - type: object mapping: $. - name: mathpix-get-document-status description: Get Document Status hints: readOnly: true idempotent: true call: document-ocr-documents.getdocumentstatus with: pdf_id: tools.pdf_id outputParameters: - type: object mapping: $. - name: mathpix-download-mmd description: Download Mathpix Markdown hints: readOnly: true idempotent: true call: document-ocr-documents.downloadmmd with: pdf_id: tools.pdf_id outputParameters: - type: string mapping: $.