Skip to main content
Glama

find_data

Locate specific values within Excel worksheets by specifying file path, sheet name, and search value to streamline data retrieval.

Instructions

ワークシート内で指定された値を検索します

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYesExcelファイルのパス
searchValueYes検索する値
sheetNameYesワークシート名

Implementation Reference

  • The main handler function that loads the Excel workbook, iterates through rows and cells in the specified sheet to find exact matches for the searchValue, and returns a string listing the matching cell addresses.
    async function findData(filePath: string, sheetName: string, searchValue: any): Promise<string> {
      try {
        const workbook = await loadWorkbook(filePath);
        const worksheet = workbook.getWorksheet(sheetName);
        if (!worksheet) {
          throw new Error(`ワークシート '${sheetName}' が見つかりません。`);
        }
        
        const results: string[] = [];
        worksheet.eachRow((row, rowNumber) => {
          row.eachCell((cell, colNumber) => {
            if (cell.value === searchValue) {
              const cellAddress = worksheet.getCell(rowNumber, colNumber).address;
              results.push(cellAddress);
            }
          });
        });
        
        return `値 '${searchValue}' が見つかったセル: ${results.join(', ')}`;
      } catch (error) {
        throw new McpError(ErrorCode.InternalError, `データ検索エラー: ${error}`);
      }
    }
  • Zod schema defining the input parameters for the find_data tool: filePath (string), sheetName (string), searchValue (string or number).
    const FindDataSchema = z.object({
      filePath: z.string().describe("Excelファイルのパス"),
      sheetName: z.string().describe("ワークシート名"),
      searchValue: z.union([z.string(), z.number()]).describe("検索する値"),
    });
  • src/index.ts:563-566 (registration)
    Tool implementation wrapper in the toolImplementations map that parses input arguments using FindDataSchema and delegates to the findData handler function. This is invoked by the CallToolRequestSchema handler.
    find_data: async (args: any) => {
      const { filePath, sheetName, searchValue } = FindDataSchema.parse(args);
      return await findData(filePath, sheetName, searchValue);
    },
  • src/index.ts:511-515 (registration)
    Registration of the find_data tool in the ListToolsRequestSchema response, providing name, description, and input schema for tool discovery.
    {
      name: "find_data",
      description: "ワークシート内で指定された値を検索します",
      inputSchema: zodToJsonSchema(FindDataSchema)
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool searches for values but doesn't describe what happens when multiple matches are found, whether the search is case-sensitive, if it returns cell locations or just values, or any error conditions. For a search operation with zero annotation coverage, this leaves significant behavioral questions unanswered.

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 extremely concise - a single Japanese sentence that directly states the tool's function. There's no wasted language or unnecessary elaboration. While it could benefit from more detail, what's present is perfectly efficient and front-loaded with the core purpose.

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 that this is a search tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what the tool returns (locations, values, both?), how results are formatted, whether there are limitations on search scope, or what happens with no matches. For a tool that presumably returns search results, the lack of output information is a significant gap.

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?

Schema description coverage is 100%, so the schema already documents all three parameters thoroughly. The description doesn't add any additional meaning beyond what's in the schema - it mentions searching for specified values in a worksheet, which aligns with but doesn't expand upon the parameter descriptions. With complete schema coverage, the baseline score of 3 is appropriate.

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

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool's purpose as searching for specified values within a worksheet, which is clear but generic. It doesn't distinguish this from similar sibling tools like 'get_cell_value' or 'get_range_values' that also retrieve data from worksheets. The description is accurate but lacks specificity about what makes this tool unique.

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?

No guidance is provided on when to use this tool versus alternatives. With sibling tools like 'get_cell_value' (for single cells) and 'get_range_values' (for ranges), the description doesn't explain that this tool searches across the entire worksheet or how it differs from those options. There's no mention of prerequisites, limitations, or typical use cases.

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

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/SuperPyonchiX/excel_mcp_server'

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