Skip to main content
Glama
ConnorBoetig-dev

Unrestricted Development MCP Server

fs_get_file_info

Retrieve detailed file or directory information including size, permissions, and timestamps for development environment analysis.

Instructions

Get detailed information about a file or directory (size, permissions, timestamps, etc.)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute or relative path to the file or directory

Implementation Reference

  • The handler function that implements the core logic for 'fs_get_file_info', using fs.stat and fs.realpath to fetch file stats and returning formatted JSON response.
    export async function getFileInfo(args: z.infer<typeof getFileInfoSchema>): Promise<ToolResponse> {
      try {
        const stats = await fs.stat(args.path);
        const realPath = await fs.realpath(args.path);
    
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify({
                success: true,
                path: args.path,
                realPath: realPath,
                type: stats.isDirectory() ? 'directory' : stats.isSymbolicLink() ? 'symlink' : 'file',
                size: stats.size,
                created: stats.birthtime,
                modified: stats.mtime,
                accessed: stats.atime,
                permissions: stats.mode.toString(8),
                uid: stats.uid,
                gid: stats.gid
              }, null, 2)
            }
          ]
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify({
                success: false,
                error: error instanceof Error ? error.message : String(error)
              }, null, 2)
            }
          ],
          isError: true
        };
      }
    }
  • Zod input validation schema used for parsing arguments before calling the handler.
    export const getFileInfoSchema = z.object({
      path: z.string().describe('Absolute or relative path to the file or directory')
    });
  • src/index.ts:333-336 (registration)
    Registration and dispatch in the main MCP CallToolRequest handler, matching tool name and invoking the validated handler.
    if (name === 'fs_get_file_info') {
      const validated = getFileInfoSchema.parse(args);
      return await getFileInfo(validated);
    }
  • MCP tool metadata definition including JSON inputSchema, used for tool listing and discovery.
    {
      name: 'fs_get_file_info',
      description: 'Get detailed information about a file or directory (size, permissions, timestamps, etc.)',
      inputSchema: {
        type: 'object',
        properties: {
          path: {
            type: 'string',
            description: 'Absolute or relative path to the file or directory'
          }
        },
        required: ['path']
      }
    },
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. It mentions retrieving 'detailed information' but doesn't disclose behavioral traits such as error handling (e.g., if the path doesn't exist), performance implications, or whether it follows symlinks. This leaves gaps in understanding how the tool behaves beyond its basic function.

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 a single, efficient sentence that front-loads the purpose and includes helpful examples ('size, permissions, timestamps, etc.'). There is no wasted text, making it easy to parse and understand quickly.

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

Completeness3/5

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

Given the tool's low complexity (1 parameter, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose but lacks details on return values or error cases, which could be important for an AI agent to use it correctly without trial and error.

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%, with the parameter 'path' well-documented in the schema. The description adds no additional meaning beyond implying the path is for a file or directory, which is already covered. Baseline 3 is appropriate as the schema handles parameter documentation adequately.

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') and resource ('detailed information about a file or directory'), with specific examples of what information is retrieved (size, permissions, timestamps). It distinguishes from sibling tools like fs_list_directory (which lists contents) and fs_read_file (which reads file content), but doesn't explicitly name these alternatives.

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

Usage Guidelines3/5

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

The description implies usage for retrieving metadata rather than content or performing operations, suggesting when to use it versus alternatives like fs_read_file or fs_list_directory. However, it lacks explicit guidance on when not to use it or clear prerequisites, leaving some ambiguity.

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/ConnorBoetig-dev/mcp2'

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