Skip to main content
Glama
gabrielmaialva33

MCP Filesystem Server

get_metrics

Retrieve performance metrics from the MCP Filesystem Server to monitor operations and troubleshoot issues effectively.

Instructions

Returns performance metrics about server operations. Useful for monitoring and debugging.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler for the 'get_metrics' tool. Retrieves metrics data using metrics.getMetrics() and returns it as formatted JSON.
    case 'get_metrics': {
      const metricsData = metrics.getMetrics()
      await logger.debug('Retrieved metrics')
    
      endMetric()
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(metricsData, null, 2),
          },
        ],
      }
    }
  • src/index.ts:336-346 (registration)
    Registration of the 'get_metrics' tool in the list of available tools, including its description and empty input schema.
    {
      name: 'get_metrics',
      description:
        'Returns performance metrics about server operations. ' +
        'Useful for monitoring and debugging.',
      inputSchema: {
        type: 'object',
        properties: {},
        required: [],
      },
    },
  • Type definition for MetricsResult, used in the output of getMetrics(). Defines structure of metrics data for each operation.
    export interface MetricsResult {
      count: number
      errors: number
      avgTime: number
    }
  • Core implementation of getMetrics() method in OperationMetrics class. Computes and returns metrics for all tracked operations including uptime.
    public getMetrics(): Record<string, MetricsResult> {
      const result: Record<string, MetricsResult> = {}
    
      for (const [name, data] of Object.entries(this.operations)) {
        result[name] = {
          count: data.count,
          errors: data.errors,
          avgTime: data.count > 0 ? data.totalTime / data.count : 0,
        }
      }
    
      // Add uptime metric
      result['uptime_ms'] = {
        count: 1,
        errors: 0,
        avgTime: performance.now() - this.startTime,
      }
    
      return result
    }
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 of behavioral disclosure. It mentions the tool is 'useful for monitoring and debugging,' which hints at read-only behavior, but fails to specify critical details like whether it requires authentication, has rate limits, returns real-time or historical data, or what format the metrics are in. This leaves significant gaps for an agent to understand how to invoke it effectively.

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 highly concise with two sentences that directly state the tool's function and utility. Every word earns its place, with no redundant or vague language. It is front-loaded with the core purpose, making it efficient for an agent to parse.

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 has no parameters and no output schema, the description provides a basic purpose and usage hint. However, for a tool returning performance metrics—which could involve complex data like CPU usage or response times—the lack of behavioral details (e.g., data format, update frequency) and no output schema means the description is minimally adequate but leaves gaps in understanding what to expect from the tool's output.

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

Parameters4/5

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

The tool has 0 parameters, and the schema description coverage is 100%, meaning no parameters need documentation. The description does not add parameter-specific information, which is appropriate here. A baseline score of 4 is applied for zero-parameter tools, as no compensation is needed for schema gaps.

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 tool's purpose with 'Returns performance metrics about server operations,' specifying both the action (returns) and resource (performance metrics). It distinguishes from siblings like 'get_file_info' or 'list_directory' by focusing on server metrics rather than file operations. However, it doesn't explicitly differentiate from all siblings, such as hypothetical monitoring tools, keeping it from a perfect score.

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 provides implied usage context with 'Useful for monitoring and debugging,' suggesting when to use this tool. However, it lacks explicit guidance on when not to use it or alternatives among siblings, such as whether to use 'execute_command' for real-time checks instead. This makes the guidance incomplete but not absent.

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/gabrielmaialva33/mcp-filesystem'

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