Skip to main content
Glama
koopatroopa787

MCP PC Control Server

get_file_info

Retrieve file metadata including size, timestamps, type, and permissions without reading file contents. Use this tool to inspect file details on your PC.

Instructions

Retrieve detailed metadata about a file or directory, including size, creation time, modification time, access time, type, and permissions. This does not read file contents.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesThe path to the file/directory

Implementation Reference

  • Handler function for get_file_info tool that retrieves file stats using fs.stat and returns formatted JSON with file metadata including type, size, timestamps, and permissions.
    case "get_file_info": {
      const filePath = args.path as string;
      const stats = await fs.stat(filePath);
    
      const info = {
        path: filePath,
        type: stats.isDirectory()
          ? "directory"
          : stats.isFile()
          ? "file"
          : "other",
        size: stats.size,
        created: stats.birthtime.toISOString(),
        modified: stats.mtime.toISOString(),
        accessed: stats.atime.toISOString(),
        permissions: stats.mode.toString(8).slice(-3),
        isReadable: fsSync.constants.R_OK,
        isWritable: fsSync.constants.W_OK,
      };
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(info, null, 2),
          },
        ],
      };
    }
  • Tool schema definition including name, description, and input schema requiring a 'path' parameter.
    {
      name: "get_file_info",
      description: "Retrieve detailed metadata about a file or directory, including size, creation time, modification time, access time, type, and permissions. This does not read file contents.",
      inputSchema: {
        type: "object",
        properties: {
          path: {
            type: "string",
            description: "The path to the file/directory",
          },
        },
        required: ["path"],
      },
    },
  • src/index.ts:261-263 (registration)
    Registration of listTools handler that returns the TOOLS array containing get_file_info.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools: TOOLS };
    });
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses that this is a read-only operation that doesn't access file contents, which is helpful behavioral context. However, it doesn't mention error conditions (e.g., what happens if path doesn't exist), performance characteristics, or authentication requirements.

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?

Two sentences with zero waste - first sentence states purpose and specific metadata attributes, second sentence provides crucial differentiation from sibling tools. Perfectly front-loaded with all essential information in minimal space.

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

Completeness4/5

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

For a simple read-only metadata tool with 1 parameter and no output schema, the description is reasonably complete. It covers purpose, scope, and differentiation from siblings. However, without annotations or output schema, it could benefit from mentioning return format or error behavior for full completeness.

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 'path' parameter fully documented in the schema. The description doesn't add any parameter-specific information beyond what the schema provides, such as path format examples or constraints. Baseline 3 is appropriate when schema does the heavy lifting.

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

Purpose5/5

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

The description clearly states the specific verb 'retrieve' and resource 'detailed metadata about a file or directory', listing specific metadata attributes (size, creation time, etc.). It explicitly distinguishes from sibling tools by stating 'This does not read file contents', differentiating it from read_file.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool (to get metadata without reading contents), but doesn't explicitly mention when not to use it or name specific alternatives. It implies usage vs. read_file but doesn't provide explicit exclusions or comparisons to other metadata-related tools.

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/koopatroopa787/first_mcp'

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