Skip to main content
Glama

get_workbook_info

Retrieve detailed information from an Excel workbook, including sheet lists and metadata, specified by file path using the MCP Server.

Instructions

Excelワークブックの詳細情報を取得します(シート一覧、メタデータ等)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYes情報を取得するExcelファイルの絶対パス

Implementation Reference

  • Zod schema for input validation of get_workbook_info tool (filePath parameter).
    const GetWorkbookInfoSchema = z.object({
      filePath: z.string().describe("情報を取得するExcelファイルの絶対パス"),
    });
  • Core handler function that loads the Excel workbook using ExcelJS and returns detailed information including sheet count, names, creator, and dates.
    async function getWorkbookInfo(filePath: string): Promise<string> {
      try {
        validateFilePath(filePath);
        
        // ファイル存在確認
        try {
          await fs.access(filePath);
        } catch {
          throw new Error(`ファイルが見つかりません: ${filePath}`);
        }
        
        const workbook = new ExcelJS.Workbook();
        await workbook.xlsx.readFile(filePath);
        
        const info = {
          ファイルパス: filePath,
          ワークシート数: workbook.worksheets.length,
          ワークシート名一覧: workbook.worksheets.map(sheet => sheet.name),
          作成者: workbook.creator || "不明",
          最終更新者: workbook.lastModifiedBy || "不明",
          作成日時: workbook.created ? workbook.created.toISOString() : "不明",
          最終更新日時: workbook.modified ? workbook.modified.toISOString() : "不明"
        };
        
        return `ワークブック情報:\n${JSON.stringify(info, null, 2)}`;
      } catch (error) {
        throw new McpError(ErrorCode.InternalError, `ワークブック情報取得エラー: ${error}`);
      }
    }
  • src/index.ts:472-474 (registration)
    Registration of the tool in the list_tools handler, specifying name, description, and input schema.
    name: "get_workbook_info",
    description: "Excelワークブックの詳細情報を取得します(シート一覧、メタデータ等)",
    inputSchema: zodToJsonSchema(GetWorkbookInfoSchema)
  • src/index.ts:531-533 (registration)
    Registration of the tool implementation in the toolImplementations map, which handles argument parsing and delegates to the core handler.
    get_workbook_info: async (args: any) => {
      const { filePath } = GetWorkbookInfoSchema.parse(args);
      return await getWorkbookInfo(filePath);
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states this is a read operation ('取得します'), but doesn't disclose important behavioral traits: whether it requires specific file permissions, what happens with invalid file paths, if it works with password-protected files, what metadata fields are returned, or any rate limits. For a file access tool with zero annotation coverage, this leaves significant gaps.

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

Conciseness4/5

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

The description is a single, efficient Japanese sentence that directly states the purpose with examples. It's appropriately sized for a simple tool, though it could be slightly more structured by separating purpose from examples. No wasted words or redundancy.

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 this is a file access tool with no annotations and no output schema, the description is incomplete. It doesn't explain what '詳細情報' (detailed information) includes beyond the examples, nor the return format. For a tool that presumably returns structured workbook metadata, more context about output expectations would help the agent use it correctly.

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%, with the single parameter 'filePath' well-described in the schema as '情報を取得するExcelファイルの絶対パス' (absolute path of Excel file to get information from). The description adds no additional parameter context beyond what the schema provides, so it meets the baseline for high schema coverage without compensating value.

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 verb ('取得します' - get/retrieve) and resource ('Excelワークブックの詳細情報' - Excel workbook detailed information), with specific examples of what information is included ('シート一覧、メタデータ等' - sheet list, metadata, etc.). It distinguishes from siblings like get_cell_value or get_range_values by focusing on workbook-level metadata rather than cell/range data. However, it doesn't explicitly differentiate from other potential metadata tools (none exist in siblings).

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. It doesn't mention when this tool is appropriate versus get_cell_value or get_range_values for different information needs, nor does it specify prerequisites like file accessibility or format requirements. The agent must infer usage from the purpose alone.

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