Skip to main content
Glama

Currents

Official
by currents-dev
get-tests-signature.ts1.35 kB
import { z } from "zod"; import { fetchApi } from "../../lib/request.js"; import { logger } from "../../lib/logger.js"; const zodSchema = z.object({ projectId: z .string() .describe("The project ID to fetch the test signature from."), spec: z.string().describe("The spec name the test belongs to."), title: z.string().describe("The test name."), }); const handler = async ({ projectId, spec, title, }: z.infer<typeof zodSchema>) => { const queryParams = new URLSearchParams(); queryParams.append( "date_start", new Date(new Date().setDate(new Date().getDate() - 365)).toISOString() ); queryParams.append("date_end", new Date().toISOString()); queryParams.append("spec", spec); queryParams.append("title", title); logger.info( `Fetching test signature for project ${projectId} with query params: ${queryParams.toString()}` ); const data = await fetchApi(`/tests/${projectId}?${queryParams.toString()}`); if (!data) { return { content: [ { type: "text" as const, text: "Failed to retrieve project test signature", }, ], }; } return { content: [ { type: "text" as const, text: JSON.stringify(data, null, 2), }, ], }; }; export const getTestSignatureTool = { schema: zodSchema.shape, handler, };

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/currents-dev/currents-mcp'

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