export type AssociationBody = {id: string}; export type CreateApiV1WorkspacesWorkspaceProjectsProjectIdMcpInstancesArgs = {project_id: string, workspace: string, body: AssociationBody}; export type CreateApiV1WorkspacesWorkspaceProjectsProjectIdMcpInstancesOptions = {baseUrl: string, HTTPBearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Add Mcp Instance To Project * * POST /v1/workspaces/{workspace}/projects/{project_id}/mcp-instances */ export const createApiV1WorkspacesWorkspaceProjectsProjectIdMcpInstances = async (args: CreateApiV1WorkspacesWorkspaceProjectsProjectIdMcpInstancesArgs, options: CreateApiV1WorkspacesWorkspaceProjectsProjectIdMcpInstancesOptions) => { const {baseUrl, fetch: fetchFn = fetch, HTTPBearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (HTTPBearer !== undefined) headers.set('authorization', `Bearer ${HTTPBearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/workspaces/${encodeURIComponent(String(args.workspace))}/projects/${encodeURIComponent(String(args.project_id))}/mcp-instances${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };