Skip to main content
Glama
john-walkoe

USPTO Final Petition Decisions MCP Server

by john-walkoe

FPD_get_document_content_with_mistral_ocr

Extract text from USPTO petition documents using hybrid extraction: free PyPDF2 for text-based PDFs, Mistral OCR for scanned documents. Analyze legal arguments, issues, and patterns in petition decisions.

Instructions

Extract full text from USPTO petition documents with intelligent hybrid extraction (PyPDF2 first, Mistral OCR fallback).

PREREQUISITE: First use fpd_get_petition_details to get document_identifier from documentBag. Auto-optimizes cost: free PyPDF2 for text-based PDFs, ~$0.001/page Mistral OCR only for scanned documents. MISTRAL_API_KEY is optional - without it, only PyPDF2 extraction is available (works well for text-based PDFs).

USE CASES:

  • Analyze petition legal arguments and Director's reasoning

  • Extract petition issues, CFR rules cited, statutory references

  • Detect patterns across multiple petitions (e.g., common denial reasons)

  • Correlate petition text with PTAB challenge strategies

  • Profile examiner behavior from supervisory review petitions

COST OPTIMIZATION:

  • auto_optimize=True (default): Try free PyPDF2 first, fallback to Mistral OCR if needed (70% cost savings)

  • auto_optimize=False: Use Mistral OCR directly (~$0.001/page)

Returns: extracted_content, extraction_method, processing_cost_usd, page_count

Example workflow:

  1. fpd_get_petition_details(petition_id='0b71b685-...', include_documents=True)

  2. fpd_get_document_content(petition_id='0b71b685-...', document_identifier='DSEN5APWPHOENIX')

  3. Analyze extracted text for legal arguments, issues, and patterns

For document selection strategies and cost optimization, use FPD_get_guidance('cost').

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
petition_idYes
document_identifierYes
auto_optimizeNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It thoroughly explains the tool's behavior: the hybrid extraction process (PyPDF2 first, Mistral OCR fallback), cost optimization details (free vs. $0.001/page), dependency on MISTRAL_API_KEY, and return values (extracted_content, extraction_method, etc.). It also covers practical aspects like cost savings (70%) and fallback mechanisms, providing rich context beyond basic functionality.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (PREREQUISITE, USE CASES, COST OPTIMIZATION, Example workflow) and front-loaded key information. However, it includes some redundancy (e.g., repeating cost details in multiple sections) and could be slightly more concise by integrating the example workflow more seamlessly. Overall, most sentences earn their place by adding value, but minor trimming is possible.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (hybrid extraction, cost optimization, prerequisites) and the absence of annotations, the description is highly complete. It explains the extraction process, cost implications, dependencies, use cases, and workflow integration. With an output schema present, it doesn't need to detail return values, but it still lists them (extracted_content, etc.) for clarity. This provides all necessary context for effective tool selection and invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0% description coverage, so the description must compensate. It adds significant meaning for all parameters: petition_id is contextualized in the prerequisite and example workflow, document_identifier is explained as coming from documentBag via fpd_get_petition_details, and auto_optimize is detailed with its default (True) and effects on cost and extraction method. This goes beyond the schema's basic titles and types, clarifying how and why to use each parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Extract full text from USPTO petition documents with intelligent hybrid extraction (PyPDF2 first, Mistral OCR fallback).' It specifies the verb ('extract'), resource ('USPTO petition documents'), and method ('hybrid extraction'), distinguishing it from sibling tools like FPD_get_document_download (which likely downloads files) and Get_petition_details (which retrieves metadata).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool, including prerequisites ('First use fpd_get_petition_details to get document_identifier from documentBag'), alternatives (e.g., using auto_optimize=False for direct OCR), and sibling tool references (e.g., 'For document selection strategies and cost optimization, use FPD_get_guidance('cost')'). It also lists specific use cases like analyzing legal arguments and detecting patterns, helping differentiate from other search or download tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/john-walkoe/uspto_fpd_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server