Skip to main content
Glama
FutureAtoms

Agentic Control Framework (ACF)

by FutureAtoms

get_file_info

Retrieve file metadata including size, modification date, and type by specifying the file path.

Instructions

File info

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes

Implementation Reference

  • Main handler function for get_file_info tool. Uses fs.statSync to get file stats (size, timestamps, type), mime-types for MIME detection, and fs.accessSync for permissions (read/write/execute). Returns success/failure response with file metadata.
    function getFileInfo(filePath, allowedDirs) {
      try {
        if (!filePath) {
          return { success: false, message: 'No file path provided' };
        }
    
        if (!isPathAllowed(filePath, allowedDirs)) {
          return { success: false, message: `Access to path "${filePath}" is not allowed` };
        }
    
        const resolvedPath = path.resolve(filePath);
        
        // Check if file exists
        if (!fs.existsSync(resolvedPath)) {
          return { success: false, message: `File not found: ${filePath}` };
        }
    
        // Get file stats
        const stats = fs.statSync(resolvedPath);
        const type = stats.isDirectory() ? 'directory' : 'file';
        
        // Determine MIME type for files
        let mimeType = null;
        if (type === 'file') {
          mimeType = mime.lookup(resolvedPath) || 'application/octet-stream';
        }
    
        return {
          success: true,
          path: filePath,
          type,
          size: stats.size,
          created: stats.birthtime.toISOString(),
          modified: stats.mtime.toISOString(),
          accessed: stats.atime.toISOString(),
          mimeType,
          permissions: {
            readable: (() => {
              try {
                fs.accessSync(resolvedPath, fs.constants.R_OK);
                return true;
              } catch {
                return false;
              }
            })(),
            writable: (() => {
              try {
                fs.accessSync(resolvedPath, fs.constants.W_OK);
                return true;
              } catch {
                return false;
              }
            })(),
            executable: (() => {
              try {
                fs.accessSync(resolvedPath, fs.constants.X_OK);
                return true;
              } catch {
                return false;
              }
            })()
          }
        };
      } catch (error) {
        logger.error(`Error getting file info: ${error.message}`);
        return { success: false, message: `Error getting file info: ${error.message}` };
      }
    }
  • Input schema registration for get_file_info in the MCP server. Defines 'path' as a required string property in the JSON object inputSchema.
    { name:'get_file_info', description:'File info', inputSchema:{ type:'object', properties:{ path:{type:'string'} }, required:['path'] } },
  • MCP server handler case dispatching get_file_info requests to filesystemTools.getFileInfo(args.path, allowedDirectories).
    case 'get_file_info':
      data = filesystemTools.getFileInfo(args.path, allowedDirectories);
  • Module export of getFileInfo function for use by the MCP server.
    getFileInfo,
  • JSDoc comment block documenting the getFileInfo function parameters and return type.
    * Gets information about a file or directory
Behavior1/5

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

No annotations exist, and the description gives no behavioral details (e.g., read-only nature, return format, error conditions). The single phrase 'File info' is entirely insufficient for a tool that likely retrieves file metadata.

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

Conciseness1/5

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

Extreme brevity is not conciseness. The description is two words with no structure, front-loading no useful information. Every sentence should earn its place, but this description earns nothing.

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

Completeness1/5

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

Given the tool's single parameter and lack of output schema, the description should clarify what information is returned. It fails entirely, making the tool nearly unusable without additional context.

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

Parameters1/5

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

The input schema defines only 'path' as a string, but with 0% schema description coverage, the description adds no semantic meaning. The agent receives no hints about valid paths, defaults, or expected format.

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

Purpose1/5

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

The description 'File info' is a tautology that merely repeats the tool name without specifying any verb or unique resource. It fails to indicate what action the tool performs or how it differs from siblings like 'read_file' or 'list_directory'.

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

Usage Guidelines1/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. Without context, an agent cannot determine whether to use 'get_file_info' or 'read_file' for metadata retrieval.

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/FutureAtoms/agentic-control-framework'

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