Skip to main content
Glama

get_filesystem_info

Retrieve metadata for files or directories in a Vertex AI workspace, including size, type, timestamps, and permissions, without accessing file content.

Instructions

Retrieve detailed metadata about a file or directory within the workspace filesystem. Returns comprehensive information including size (bytes), creation time, last modified time, last accessed time, type (file/directory), and permissions (octal string). This tool is perfect for understanding file characteristics without reading the actual content.

Input Schema

NameRequiredDescriptionDefault
pathYesThe path of the file or directory to get info for (relative to the workspace directory).

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "path": { "description": "The path of the file or directory to get info for (relative to the workspace directory).", "type": "string" } }, "required": [ "path" ], "type": "object" }

Implementation Reference

  • Main handler case for 'get_filesystem_info' tool: parses arguments, validates path, calls getFileStats helper, formats and sets resultText.
    case "get_filesystem_info": { const parsed = GetFileInfoArgsSchema.parse(args); const validPath = validateWorkspacePath(parsed.path); const info = await getFileStats(validPath); resultText = `Path: ${parsed.path}\nType: ${info.isDirectory ? 'Directory' : 'File'}\nSize: ${info.size} bytes\nCreated: ${info.created.toISOString()}\nModified: ${info.modified.toISOString()}\nAccessed: ${info.accessed.toISOString()}\nPermissions: ${info.permissions}`; break;
  • Helper function that retrieves comprehensive file/directory stats including size, timestamps, type, and permissions.
    async function getFileStats(filePath: string): Promise<FileInfo> { const stats = await fs.stat(filePath); return { size: stats.size, created: stats.birthtime, modified: stats.mtime, accessed: stats.atime, isDirectory: stats.isDirectory(), isFile: stats.isFile(), permissions: stats.mode.toString(8).slice(-3), // POSIX permissions }; }
  • Zod schema defining the input parameters for the tool (path string).
    export const GetFileInfoArgsSchema = z.object({ path: z.string().describe("The path of the file or directory to get info for (relative to the workspace directory)."), });
  • Import of the getFileInfoTool definition for inclusion in allTools and toolMap.
    import { getFileInfoTool } from "./get_file_info.js";
  • Addition of getFileInfoTool to the allTools array, enabling listing and lookup via toolMap.
    searchFilesTool, getFileInfoTool,

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/shariqriazz/vertex-ai-mcp-server'

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