Skip to main content
Glama

get_cell

Retrieve the value from a specific cell in Excel or CSV files using A1 notation. Specify file path and cell address to extract data for analysis.

Instructions

Get the value of a specific cell using A1 notation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYesPath to the CSV or Excel file
cellYesCell address in A1 notation (e.g., "A1", "B5")
sheetNoSheet name for Excel files (optional)

Implementation Reference

  • The handler function that executes the get_cell tool. It reads the specified file/sheet, parses the A1 cell notation, validates bounds, retrieves the cell value, and returns it in a standardized ToolResponse format.
    async getCell(args: ToolArgs): Promise<ToolResponse> { try { const { filePath, cell, sheet } = args; const data = await readFileContent(filePath, sheet); if (!cell || typeof cell !== 'string') { return { content: [ { type: 'text', text: JSON.stringify({ success: false, error: 'Invalid cell reference', }, null, 2), }, ], }; } const { row, col } = parseA1Notation(cell); if (row >= data.length || col >= (data[0]?.length || 0)) { return { content: [ { type: 'text', text: JSON.stringify({ success: false, error: `Cell ${cell} is out of range`, }, null, 2), }, ], }; } const value = data[row][col]; return { content: [ { type: 'text', text: JSON.stringify({ success: true, cellValue: value, cellAddress: cell, }, null, 2), }, ], }; } catch (error) { return { content: [ { type: 'text', text: JSON.stringify({ success: false, error: error instanceof Error ? error.message : 'Unknown error occurred', }, null, 2), }, ], }; } }
  • The input schema definition and tool metadata (name, description) for the get_cell tool, registered in the ListTools response.
    name: 'get_cell', description: 'Get the value of a specific cell using A1 notation', inputSchema: { type: 'object', properties: { filePath: { type: 'string', description: 'Path to the CSV or Excel file', }, cell: { type: 'string', description: 'Cell address in A1 notation (e.g., "A1", "B5")', }, sheet: { type: 'string', description: 'Sheet name for Excel files (optional)', }, }, required: ['filePath', 'cell'], }, },
  • src/index.ts:1202-1202 (registration)
    The dispatch registration in the CallToolRequestSchema handler that routes calls to the getCell method on the DataOperationsHandler instance.
    return await this.dataOpsHandler.getCell(toolArgs);

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/ishayoyo/excel-mcp'

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