pdfco-mcp 0.0.6__tar.gz → 0.0.7__tar.gz
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.
- {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/PKG-INFO +1 -1
- {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/pdfco/mcp/tools/apis/job.py +26 -19
- {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/pyproject.toml +1 -1
- {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/.github/workflows/release.yml +0 -0
- {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/.gitignore +0 -0
- {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/.pre-commit-config.yaml +0 -0
- {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/.python-version +0 -0
- {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/LICENSE +0 -0
- {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/README.md +0 -0
- {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/pdfco/mcp/__init__.py +0 -0
- {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/pdfco/mcp/models.py +0 -0
- {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/pdfco/mcp/server.py +0 -0
- {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/pdfco/mcp/services/__init__.py +0 -0
- {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/pdfco/mcp/services/client.py +0 -0
- {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/pdfco/mcp/services/pdf.py +0 -0
- {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/pdfco/mcp/tools/__init__.py +0 -0
- {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/pdfco/mcp/tools/apis/conversion.py +0 -0
- {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/pdfco/mcp/tools/apis/document.py +0 -0
- {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/pdfco/mcp/tools/apis/editing.py +0 -0
- {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/pdfco/mcp/tools/apis/extraction.py +0 -0
- {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/pdfco/mcp/tools/apis/file.py +0 -0
- {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/pdfco/mcp/tools/apis/form.py +0 -0
- {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/pdfco/mcp/tools/apis/modification.py +0 -0
- {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/pdfco/mcp/tools/apis/search.py +0 -0
- {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/pdfco/mcp/tools/apis/searchable.py +0 -0
- {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/pdfco/mcp/tools/apis/security.py +0 -0
- {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/uv.lock +0 -0
@@ -7,22 +7,9 @@ from pdfco.mcp.models import BaseResponse
|
|
7
7
|
from pydantic import Field
|
8
8
|
|
9
9
|
|
10
|
-
|
11
|
-
async def get_job_check(
|
12
|
-
job_id: str = Field(description="The ID of the job to get the status of"),
|
13
|
-
api_key: str = Field(
|
14
|
-
description="PDF.co API key. If not provided, will use X_API_KEY environment variable. (Optional)",
|
15
|
-
default="",
|
16
|
-
),
|
17
|
-
) -> BaseResponse:
|
10
|
+
async def _get_job_status(job_id: str, api_key: str = "") -> BaseResponse:
|
18
11
|
"""
|
19
|
-
|
20
|
-
Status can be:
|
21
|
-
- working: background job is currently in work or does not exist.
|
22
|
-
- success: background job was successfully finished.
|
23
|
-
- failed: background job failed for some reason (see message for more details).
|
24
|
-
- aborted: background job was aborted.
|
25
|
-
- unknown: unknown background job id. Available only when force is set to true for input request.
|
12
|
+
Internal helper function to check job status without MCP tool decoration
|
26
13
|
"""
|
27
14
|
try:
|
28
15
|
async with PDFCoClient(api_key=api_key) as client:
|
@@ -47,6 +34,26 @@ async def get_job_check(
|
|
47
34
|
)
|
48
35
|
|
49
36
|
|
37
|
+
@mcp.tool()
|
38
|
+
async def get_job_check(
|
39
|
+
job_id: str = Field(description="The ID of the job to get the status of"),
|
40
|
+
api_key: str = Field(
|
41
|
+
description="PDF.co API key. If not provided, will use X_API_KEY environment variable. (Optional)",
|
42
|
+
default="",
|
43
|
+
),
|
44
|
+
) -> BaseResponse:
|
45
|
+
"""
|
46
|
+
Check the status and results of a job
|
47
|
+
Status can be:
|
48
|
+
- working: background job is currently in work or does not exist.
|
49
|
+
- success: background job was successfully finished.
|
50
|
+
- failed: background job failed for some reason (see message for more details).
|
51
|
+
- aborted: background job was aborted.
|
52
|
+
- unknown: unknown background job id. Available only when force is set to true for input request.
|
53
|
+
"""
|
54
|
+
return await _get_job_status(job_id, api_key)
|
55
|
+
|
56
|
+
|
50
57
|
@mcp.tool()
|
51
58
|
async def wait_job_completion(
|
52
59
|
job_id: str = Field(description="The ID of the job to get the status of"),
|
@@ -69,10 +76,10 @@ async def wait_job_completion(
|
|
69
76
|
credits_used = 0
|
70
77
|
credits_remaining = 0
|
71
78
|
while True:
|
72
|
-
response = await
|
79
|
+
response = await _get_job_status(job_id, api_key=api_key)
|
73
80
|
job_check_count += 1
|
74
|
-
credits_used += response.credits_used
|
75
|
-
credits_remaining = response.credits_remaining
|
81
|
+
credits_used += response.credits_used or 0
|
82
|
+
credits_remaining = response.credits_remaining or 0
|
76
83
|
if response.status == "success":
|
77
84
|
return BaseResponse(
|
78
85
|
status="success",
|
@@ -84,7 +91,7 @@ async def wait_job_completion(
|
|
84
91
|
elif response.status == "failed":
|
85
92
|
return BaseResponse(
|
86
93
|
status="error",
|
87
|
-
content=response.
|
94
|
+
content=response.content,
|
88
95
|
credits_used=credits_used,
|
89
96
|
credits_remaining=credits_remaining,
|
90
97
|
)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|