Skip to main content
Glama
search-proposals.ts840 B
import { type Tool } from 'fastmcp'; import { z } from 'zod'; import { get } from '../../utils/requests.js'; import { proposalsListSchema } from '../../schemas/proposals.js'; import { throwApiInvalidResponseError } from '../../utils/errors.js'; const parameters = z.object({ search: z.string(), }); export const searchProposalsTool: Tool<typeof parameters._type, typeof parameters> = { name: 'search_proposals', description: 'Search for proposals by query', parameters, annotations: { title: 'Search Proposals', openWorldHint: true, }, async execute({ search }) { const result = await get(`/proposals/open/?query=${encodeURIComponent(search)}`); const parsed = proposalsListSchema.safeParse(result); if (!parsed.success) { throwApiInvalidResponseError(parsed.error); } return JSON.stringify(parsed.data); }, };

Latest Blog Posts

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/offorte/offorte-mcp-server'

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