search_proposals
Find relevant proposals by entering specific search terms to locate documents matching your criteria within the proposal database.
Instructions
Search for proposals by query
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| search | Yes |
Input Schema (JSON Schema)
{
"properties": {
"search": {
"type": "string"
}
},
"required": [
"search"
],
"type": "object"
}
Implementation Reference
- The main handler function for the 'search_proposals' tool. It fetches proposals from the API using the search query, validates the response with proposalsListSchema, and returns the JSON string of the parsed data.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); },
- Input schema definition for the tool using Zod: requires a 'search' string parameter.const parameters = z.object({ search: z.string(), });
- src/tools/register.ts:31-31 (registration)The searchProposalsTool is added to the tools array for registration.searchProposalsTool,
- src/tools/register.ts:37-39 (registration)The registerTools function that adds all tools, including searchProposalsTool, to the FastMCP server.export function registerTools({ server }: { server: FastMCP }) { (tools as unknown as FastMCPTool<Record<string, unknown>, ToolParameters>[]).map(initialContextGuard).forEach((tool) => server.addTool(tool)); }
- Import of the output schema used for parsing the API response.import { proposalsListSchema } from '../../schemas/proposals.js';