Skip to main content
Glama

parse_cv_pdf

Extract text and structure from existing CV PDF files to enable automated resume building and updates with LaTeX formatting support.

Instructions

Parse an existing CV PDF file to extract text content and structure

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pdfPathYesRelative or absolute path to the CV PDF file

Implementation Reference

  • The core handler function for the parse_cv_pdf tool. It reads the PDF file using pypdf.PdfReader, extracts text from all pages, and returns the content wrapped in TextContent with metadata.
    async def parse_cv_pdf(pdf_path: Optional[str]) -> list[TextContent]: """Parse a PDF CV file.""" if not pdf_path: return [TextContent(type="text", text="Error: pdfPath parameter is required")] # Resolve path if pdf_path.startswith('/'): resolved_path = Path(pdf_path) else: resolved_path = Path(REPO_PATH) / pdf_path if not resolved_path.exists(): return [TextContent(type="text", text=f"PDF file not found: {resolved_path}")] try: # Parse PDF reader = pypdf.PdfReader(str(resolved_path)) text = "" for page in reader.pages: text += page.extract_text() + "\n" output = f"""PDF CV Parsed Successfully: File: {pdf_path} Pages: {len(reader.pages)} pages Text Length: {len(text)} characters --- EXTRACTED CONTENT --- {text} --- END OF CONTENT --- This content can now be used to generate an enhanced CV with recent work data.""" return [TextContent(type="text", text=output)] except Exception as e: return [TextContent(type="text", text=f"PDF parsing error: {str(e)}")]
  • The input schema definition for the parse_cv_pdf tool, specifying that pdfPath is a required string parameter.
    Tool( name="parse_cv_pdf", description="Parse an existing CV PDF file to extract text content and structure", inputSchema={ "type": "object", "properties": { "pdfPath": { "type": "string", "description": "Relative or absolute path to the CV PDF file" } }, "required": ["pdfPath"] } ),
  • The dispatch logic in the main @app.call_tool() handler that routes calls to the parse_cv_pdf function.
    elif name == "parse_cv_pdf": return await parse_cv_pdf(arguments.get("pdfPath"))

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/eyaab/cv-resume-builder-mcp'

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