metrics.get
Retrieve detailed information about specific Facebook Insights metrics by exact name for comprehensive analytics data access.
Instructions
Returns full details of a metric by exact name
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The exact name of the metric to retrieve |
Implementation Reference
- src/server.ts:156-175 (handler)MCP tool handler for 'metrics.get': extracts the 'name' parameter, retrieves the metric using MetricsLoader.getMetric, and returns it as JSON or error if not found.case 'metrics.get': { const { name: metricName } = args as { name: string }; if (!metricName) { throw new Error('name parameter is required'); } const metric = this.metricsLoader.getMetric(metricName); if (!metric) { throw new Error(`Metric not found: ${metricName}`); } return { content: [ { type: 'text', text: JSON.stringify(metric, null, 2) } ] }; }
- src/server.ts:85-97 (registration)Tool registration in ListToolsResponse, including name, description, and input schema requiring 'name' parameter.{ name: 'metrics.get', description: 'Returns full details of a metric by exact name', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'The exact name of the metric to retrieve', }, }, required: ['name'], },
- src/schema.ts:9-18 (schema)Zod schema defining the Metric type structure used for validation and typing the output of metrics.get.export const MetricSchema = z.object({ name: z.string(), level: LevelSchema, description: z.string(), periods: z.array(PeriodSchema), dataType: DataTypeSchema, notes: z.string().optional(), tags: z.array(z.string()).optional(), deprecated: z.boolean().optional() });
- src/loader.ts:68-71 (helper)Core helper function that loads the metrics data and returns the metric matching the exact name using Array.find.getMetric(name: string): Metric | undefined { const metrics = this.loadMetrics(); return metrics.metrics.find(metric => metric.name === name); }