Skip to main content
Glama
ishayoyo

Excel MCP Server

by ishayoyo

search

Find cells containing specific values in Excel or CSV files to locate data quickly. Use exact or partial matching across sheets for efficient data analysis.

Instructions

Search for cells containing a specific value

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYesPath to the CSV or Excel file
searchValueYesValue to search for
exactNoWhether to match exactly or contains (default: false)
sheetNoSheet name for Excel files (optional)

Implementation Reference

  • The handler function that implements the core logic of the 'search' tool. It reads the file content, iterates through all cells, checks for exact or partial matches against the searchValue, and returns a list of matching cells with their positions.
    async search(args: ToolArgs): Promise<ToolResponse> {
      try {
        const { filePath, searchValue, exact = false, sheet } = args;
        const data = await readFileContent(filePath, sheet);
        const matches = [];
    
        for (let row = 0; row < data.length; row++) {
          for (let col = 0; col < (data[row]?.length || 0); col++) {
            const cellValue = String(data[row][col]);
            const isMatch = exact
              ? cellValue === searchValue
              : cellValue.toLowerCase().includes(searchValue.toLowerCase());
    
            if (isMatch) {
              const colLetter = String.fromCharCode(65 + (col % 26));
              matches.push({
                cell: `${colLetter}${row + 1}`,
                value: data[row][col],
                row: row + 1,
                column: col + 1,
              });
            }
          }
        }
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({
                success: true,
                searchValue,
                found: matches.length,
                matches,
              }, 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 for the 'search' tool in the ListTools response, specifying the parameters, types, descriptions, and required fields.
      name: 'search',
      description: 'Search for cells containing a specific value',
      inputSchema: {
        type: 'object',
        properties: {
          filePath: {
            type: 'string',
            description: 'Path to the CSV or Excel file',
          },
          searchValue: {
            type: 'string',
            description: 'Value to search for',
          },
          exact: {
            type: 'boolean',
            description: 'Whether to match exactly or contains (default: false)',
          },
          sheet: {
            type: 'string',
            description: 'Sheet name for Excel files (optional)',
          },
        },
        required: ['filePath', 'searchValue'],
      },
    },
  • src/index.ts:1207-1208 (registration)
    The dispatch registration in the CallToolRequestSchema handler's switch statement, mapping the tool name 'search' to the DataOperationsHandler.search method.
    case 'search':
      return await this.dataOpsHandler.search(toolArgs);
Behavior2/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 mentions searching for cells containing values, but doesn't describe what happens when matches are found (are they returned? highlighted? counted?), whether this is a read-only operation, what permissions might be needed, or any performance considerations. For a search tool with zero annotation coverage, this is insufficient behavioral context.

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

Conciseness5/5

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

The description is perfectly concise at 7 words, front-loading the core purpose with zero wasted words. Every word earns its place, making it immediately clear what the tool does without unnecessary elaboration.

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

Completeness2/5

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

Given the complexity of a search operation with 4 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what the tool returns (list of cells? count? modified file?), doesn't mention performance implications for large files, and provides no context about error conditions or limitations. For a tool with this level of complexity and no structured metadata, the description should do more.

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

Parameters3/5

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

The schema description coverage is 100%, so the schema already fully documents all 4 parameters. The description doesn't add any parameter semantics beyond what's in the schema - it doesn't explain the relationship between parameters or provide usage examples. With complete schema coverage, the baseline is 3 even without additional parameter information in the description.

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

Purpose4/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: 'Search for cells containing a specific value' - this specifies the verb (search), resource (cells in files), and target (specific value). However, it doesn't differentiate from sibling tools like 'filter_rows' or 'find_duplicates' which might have overlapping search functionality, so it doesn't reach the highest clarity level.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. With many sibling tools that might perform similar operations (filter_rows, find_duplicates, smart_data_analysis), there's no indication of when this specific search tool is appropriate versus other options. The description only states what it does, not when to choose it.

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

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