Skip to main content
Glama
KarimTarekDev

Facebook Insights Metrics v23

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
NameRequiredDescriptionDefault
nameYesThe exact name of the metric to retrieve

Implementation Reference

  • 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'], },
  • 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() });
  • 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); }

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/KarimTarekDev/facebook-insights-metrics-v23'

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