Skip to main content
Glama
pdfdotco

PDF.co MCP Server

Official
by pdfdotco

excel_to_txt

Convert Excel files (XLS, XLSX) to plain text format for data extraction and processing. Use this tool to transform spreadsheet data into readable text documents.

Instructions

Convert Excel(XLS, XLSX) to TXT. Ref: https://developer.pdf.co/api-reference/convert-from-excel/text.md

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL to the source file (XLS, XLSX). Supports publicly accessible links including Google Drive, Dropbox, PDF.co Built-In Files Storage. Use 'upload_file' tool to upload local files.
httpusernameNoHTTP auth user name if required to access source url. (Optional)
httppasswordNoHTTP auth password if required to access source url. (Optional)
nameNoFile name for the generated output. (Optional)
worksheetIndexNoIndex of the worksheet to convert. (Optional)
api_keyNoPDF.co API key. If not provided, will use X_API_KEY environment variable. (Optional)

Implementation Reference

  • The handler function for the excel_to_txt tool. Decorated with @mcp.tool() for registration and schema definition via Pydantic Fields. Implements the tool by calling the convert_to helper with 'xls' to 'txt' parameters.
    @mcp.tool() async def excel_to_txt( url: str = Field( description="URL to the source file (XLS, XLSX). Supports publicly accessible links including Google Drive, Dropbox, PDF.co Built-In Files Storage. Use 'upload_file' tool to upload local files." ), httpusername: str = Field( description="HTTP auth user name if required to access source url. (Optional)", default="", ), httppassword: str = Field( description="HTTP auth password if required to access source url. (Optional)", default="", ), name: str = Field( description="File name for the generated output. (Optional)", default="" ), worksheetIndex: str = Field( description="Index of the worksheet to convert. (Optional)", default="" ), api_key: str = Field( description="PDF.co API key. If not provided, will use X_API_KEY environment variable. (Optional)", default="", ), ) -> BaseResponse: """ Convert Excel(XLS, XLSX) to TXT. Ref: https://developer.pdf.co/api-reference/convert-from-excel/text.md """ return await convert_to( "xls", "txt", ConversionParams( url=url, httpusername=httpusername, httppassword=httppassword, name=name, worksheetIndex=worksheetIndex, api_key=api_key, ), )
  • Supporting helper function that constructs the PDF.co API endpoint for generic format conversion and calls the request function to execute the HTTP POST request.
    async def convert_to( _from: str, _to: str, params: ConversionParams, api_key: str | None = None ) -> BaseResponse: return await request(f"{_from}/convert/to/{_to}", params, api_key=api_key)

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/pdfdotco/pdfco-mcp'

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