@noedgeai-org/doc2x-mcp 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/doc2x/pdf.js CHANGED
@@ -90,11 +90,15 @@ export async function parsePdfSubmit(pdfPath) {
90
90
  }
91
91
  export async function parsePdfStatus(uid) {
92
92
  const data = await doc2xRequestJson(HTTP_METHOD_GET, v2('/parse/status'), { query: { uid } });
93
+ const status = String(data.status);
94
+ const progressRaw = Number(data.progress ?? 0);
95
+ const progress = Number.isFinite(progressRaw) ? _.clamp(Math.floor(progressRaw), 0, 100) : 0;
96
+ const detail = status === DOC2X_TASK_STATUS_FAILED ? String(data.detail || '') : '';
93
97
  return {
94
98
  uid,
95
- status: String(data.status),
96
- progress: Number(data.progress ?? 0),
97
- detail: String(data.detail || ''),
99
+ status,
100
+ progress,
101
+ detail,
98
102
  result: data.result ?? null,
99
103
  };
100
104
  }
package/dist/index.js CHANGED
File without changes
@@ -43,13 +43,14 @@ export function registerTools(server) {
43
43
  }
44
44
  });
45
45
  server.registerTool('doc2x_parse_pdf_status', {
46
- description: 'Get status/result for an existing Doc2x PDF parse task by uid.',
46
+ description: 'Query parse task status by uid. Returns {status, progress, detail}. status is one of processing/failed/success; progress is an integer 0..100; detail is populated only when status=failed. Fetch parsed content via doc2x_convert_export_*.',
47
47
  inputSchema: {
48
48
  uid: z.string().min(1).describe('Doc2x parse task uid returned by doc2x_parse_pdf_submit.'),
49
49
  },
50
- }, async ({ uid }) => {
50
+ }, async (args) => {
51
51
  try {
52
- return asJsonResult(await parsePdfStatus(uid));
52
+ const st = await parsePdfStatus(args.uid);
53
+ return asJsonResult({ status: st.status, progress: st.progress, detail: st.detail });
53
54
  }
54
55
  catch (e) {
55
56
  return asErrorResult(e);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noedgeai-org/doc2x-mcp",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Doc2x MCP server (stdio, MCP SDK).",
5
5
  "license": "MIT",
6
6
  "engines": {