Skip to main content
Glama

read_excel

Extract data from Excel (xlsx) files into structured JSON format with a specified file path. Ideal for accessing workbook or sheet content programmatically.

Instructions

Read content from Excel (xlsx) files

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYesPath to the Excel file

Implementation Reference

  • Registration of the 'read_excel' tool in the list_tools() handler, defining its name, description, and input schema.
    types.Tool( name="read_excel", description="Read content from Excel (xlsx) files", inputSchema={ "type": "object", "properties": { "file_path": { "type": "string", "description": "Path to the Excel file" } }, "required": ["file_path"] } ),
  • JSON Schema for input validation of the 'read_excel' tool, requiring 'file_path'.
    inputSchema={ "type": "object", "properties": { "file_path": { "type": "string", "description": "Path to the Excel file" } }, "required": ["file_path"] }
  • Core handler logic for executing the 'read_excel' tool: loads the workbook, iterates over all sheets, reads rows and cells into a nested list structure, and stores in a result dictionary by sheet name.
    if name == "read_excel": # Original functionality - process all sheets for sheet_name in workbook.sheetnames: sheet = workbook[sheet_name] sheet_data = [] for row in sheet.rows: row_data = [str(cell.value) if cell.value is not None else "" for cell in row] sheet_data.append(row_data) result[sheet_name] = sheet_data

Other Tools

Related 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/softgridinc-pte-ltd/mcp-excel-reader-server'

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