Skip to main content
Glama

Squad AI

getUser.ts1.1 kB
import { z } from "zod"; import { squadClient } from "../lib/clients/squad.js"; export type UserContext = { orgId: string; workspaceId: string; jwt?: string; }; let context: UserContext | null = null; export const getUserContext = async () => { try { if (context) { return context; } const user = await squadClient().whoAmI(); const orgId = user.data.organisation.id; const workspaceId = user.data.workspace.id; context = { orgId, workspaceId }; return context; } catch (e) { console.error("error", e); throw e; } }; export const chatToolHelperSchema = ({ defaultInProgressText = "Thinking...", defaultCompletedText = "Done", }: { defaultInProgressText?: string; defaultCompletedText?: string; }) => z.object({ inProgressText: z .string() .optional() .default(defaultInProgressText) .describe("Text to display while the tool is in progress"), completedText: z .string() .optional() .default(defaultCompletedText) .describe("Text to display when the tool has completed"), });

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/the-basilisk-ai/squad-mcp'

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