Skip to main content
Glama
queryDatasourceValidator.ts812 B
import { z } from 'zod'; import { FilterField, Query } from '../../sdks/tableau/apis/vizqlDataServiceApi.js'; import { validateDatasourceLuid } from '../validateDatasourceLuid.js'; import { validateFields } from './validators/validateFields.js'; import { validateFilters } from './validators/validateFilters.js'; export type Query = z.infer<typeof Query>; export type FilterField = z.infer<typeof FilterField>; export function validateQuery({ datasourceLuid, query, }: { datasourceLuid: string; query: Query; }): void { validateDatasourceLuid({ datasourceLuid }); const { fields, filters } = query; validateFields(fields); validateFilters(filters); const result = Query.safeParse(query); if (!result.success) { throw new Error('The query does not match the expected schema.'); } }

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