get-projects.ts•599 B
import { z } from "zod";
import { fetchCursorBasedPaginatedApi } from "../../lib/request.js";
const zodSchema = z.object({});
const handler = async () => {
const data = await fetchCursorBasedPaginatedApi("/projects");
if (!data) {
return {
content: [
{
type: "text" as const,
text: "Failed to retrieve projects",
},
],
};
}
return {
content: [
{
type: "text" as const,
text: JSON.stringify(data, null, 2),
},
],
};
};
export const getProjectsTool = {
schema: zodSchema.shape,
handler,
};