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.
Files changed (27) hide show
  1. {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/PKG-INFO +1 -1
  2. {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/pdfco/mcp/tools/apis/job.py +26 -19
  3. {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/pyproject.toml +1 -1
  4. {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/.github/workflows/release.yml +0 -0
  5. {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/.gitignore +0 -0
  6. {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/.pre-commit-config.yaml +0 -0
  7. {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/.python-version +0 -0
  8. {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/LICENSE +0 -0
  9. {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/README.md +0 -0
  10. {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/pdfco/mcp/__init__.py +0 -0
  11. {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/pdfco/mcp/models.py +0 -0
  12. {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/pdfco/mcp/server.py +0 -0
  13. {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/pdfco/mcp/services/__init__.py +0 -0
  14. {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/pdfco/mcp/services/client.py +0 -0
  15. {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/pdfco/mcp/services/pdf.py +0 -0
  16. {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/pdfco/mcp/tools/__init__.py +0 -0
  17. {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/pdfco/mcp/tools/apis/conversion.py +0 -0
  18. {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/pdfco/mcp/tools/apis/document.py +0 -0
  19. {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/pdfco/mcp/tools/apis/editing.py +0 -0
  20. {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/pdfco/mcp/tools/apis/extraction.py +0 -0
  21. {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/pdfco/mcp/tools/apis/file.py +0 -0
  22. {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/pdfco/mcp/tools/apis/form.py +0 -0
  23. {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/pdfco/mcp/tools/apis/modification.py +0 -0
  24. {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/pdfco/mcp/tools/apis/search.py +0 -0
  25. {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/pdfco/mcp/tools/apis/searchable.py +0 -0
  26. {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/pdfco/mcp/tools/apis/security.py +0 -0
  27. {pdfco_mcp-0.0.6 → pdfco_mcp-0.0.7}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pdfco-mcp
3
- Version: 0.0.6
3
+ Version: 0.0.7
4
4
  Summary: MCP server for PDF.Co
5
5
  Project-URL: Homepage, https://pdf.co
6
6
  Project-URL: Documentation, https://developer.pdf.co
@@ -7,22 +7,9 @@ from pdfco.mcp.models import BaseResponse
7
7
  from pydantic import Field
8
8
 
9
9
 
10
- @mcp.tool()
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
- Check the status and results of a job
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 get_job_check(job_id, api_key=api_key)
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.message,
94
+ content=response.content,
88
95
  credits_used=credits_used,
89
96
  credits_remaining=credits_remaining,
90
97
  )
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pdfco-mcp"
3
- version = "0.0.6"
3
+ version = "0.0.7"
4
4
  description = "MCP server for PDF.Co"
5
5
  authors = [
6
6
  { name = "PDF.Co", email = "support@pdf.co" }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes