Skip to main content
Glama
constrainPulseMetrics.ts1.07 kB
import { BoundedContext } from '../../config.js'; import { PulseMetric } from '../../sdks/tableau/types/pulse.js'; import { ConstrainedResult } from '../tool.js'; export function constrainPulseMetrics({ metrics, boundedContext, }: { boundedContext: BoundedContext; metrics: Array<PulseMetric>; }): ConstrainedResult<Array<PulseMetric>> { if (metrics.length === 0) { return { type: 'empty', message: 'No Pulse Metrics were found. Either none exist or you do not have permission to view them.', }; } const { datasourceIds } = boundedContext; if (datasourceIds) { metrics = metrics.filter((metric) => datasourceIds.has(metric.datasource_luid)); } if (metrics.length === 0) { return { type: 'empty', message: [ 'The set of allowed Pulse Metrics that can be queried is limited by the server configuration.', 'While Pulse Metrics were found, they were all filtered out by the server configuration.', ].join(' '), }; } return { type: 'success', result: metrics, }; }

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/datalabs89/tableau-mcp'

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