Skip to main content
Glama
A-Niranjan

MCP Filesystem Server

by A-Niranjan

get_metrics

Retrieve performance metrics for monitoring and debugging server operations in the MCP Filesystem Server environment.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for 'get_metrics': calls metrics.getMetrics() and returns the JSON-stringified metrics data as tool response.
    case 'get_metrics': {
      const metricsData = metrics.getMetrics()
      await logger.debug('Retrieved metrics')
    
      endMetric()
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(metricsData, null, 2),
          },
        ],
      }
    }
  • Core implementation of getMetrics(): aggregates operation stats (count, errors, avgTime) and adds uptime metric.
    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
    }
  • src/index.ts:336-346 (registration)
    Registration of 'get_metrics' tool in the tools list for list_tools handler, including empty input schema (no arguments required).
    {
      name: 'get_metrics',
      description:
        'Returns performance metrics about server operations. ' +
        'Useful for monitoring and debugging.',
      inputSchema: {
        type: 'object',
        properties: {},
        required: [],
      },
    },
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states this is a read operation ('Returns'), but doesn't specify what types of metrics are included, whether authentication is required, if there are rate limits, or what the return format looks like. The description is too vague for a tool that presumably provides system performance data.

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

Conciseness4/5

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

The description is appropriately concise with two sentences that each add value. The first sentence states the core purpose, and the second provides usage context. There's no redundant information or unnecessary elaboration.

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

Completeness2/5

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

For a monitoring tool with no annotations and no output schema, the description is insufficient. It doesn't specify what types of metrics are returned (CPU, memory, disk, network), the format of the response, whether this requires elevated permissions, or how frequently metrics can be queried. The vague 'performance metrics' leaves too much ambiguity for effective use.

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 with 100% schema description coverage, so the schema fully documents the lack of inputs. The description appropriately doesn't waste space discussing parameters that don't exist, maintaining focus on what the tool does rather than its inputs.

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 by focusing on monitoring data rather than file operations or command execution, though it doesn't explicitly name 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 provides implied usage context with 'Useful for monitoring and debugging', suggesting when this tool might be appropriate. However, it doesn't give explicit guidance on when to use this versus other tools or any prerequisites for usage.

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

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