Skip to main content
Glama
authenticatedMethods.ts1.05 kB
import { ZodiosEndpointDefinitions, ZodiosInstance } from '@zodios/core'; import { Credentials } from '../types/credentials.js'; import Methods from './methods.js'; type AuthHeaders = { headers: { 'X-Tableau-Auth': string; }; }; /** * Base abstract class for any methods classes that require authentication. * * @export * @abstract * @class AuthenticatedMethods */ export default abstract class AuthenticatedMethods< T extends ZodiosEndpointDefinitions, > extends Methods<T> { private _creds: Credentials; protected get authHeader(): AuthHeaders { if (!this._creds) { throw new Error('Authenticate by calling signIn() first'); } return { headers: { 'X-Tableau-Auth': this._creds.token, }, }; } protected get userId(): string { if (!this._creds) { throw new Error('Authenticate by calling signIn() first'); } return this._creds.user.id; } constructor(apiClient: ZodiosInstance<T>, creds: Credentials) { super(apiClient); this._creds = creds; } }

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