metrics.list
Retrieve a complete list of all available Facebook Insights metrics with basic information for comprehensive analytics data access and metric discovery.
Instructions
Returns a list of all metrics with basic information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server.ts:77-84 (registration)Registration of the 'metrics.list' tool, including its name, description, and input schema (no required parameters).{ name: 'metrics.list', description: 'Returns a list of all metrics with basic information', inputSchema: { type: 'object', properties: {}, }, },
- src/server.ts:136-154 (handler)Handler function for the 'metrics.list' tool. Fetches all metrics using getMetrics(), maps them to basic fields (name, level, periods, dataType, deprecated), and returns as formatted JSON text content.case 'metrics.list': { const metrics = this.getMetrics(); const result = metrics.map(metric => ({ name: metric.name, level: metric.level, periods: metric.periods, dataType: metric.dataType, deprecated: metric.deprecated || false })); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ] }; }
- src/loader.ts:76-79 (helper)Helper method in MetricsLoader that loads the metrics file (if not cached) and returns the array of all Metric objects.getAllMetrics(): Metric[] { const metrics = this.loadMetrics(); return metrics.metrics; }
- src/server.ts:281-283 (helper)Server helper method that delegates to MetricsLoader.getAllMetrics() to retrieve all metrics.private getMetrics(): Metric[] { return this.metricsLoader.getAllMetrics(); }