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: [], }, },

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