list_subsidies
Search for subsidies currently accepting applications using keywords to find available funding opportunities.
Instructions
Search for subsidies currently accepting applications using the specified keyword. Default is '補助金' (subsidy).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keyword | No | Search keyword | 補助金 |
Implementation Reference
- index.ts:120-157 (handler)Handler for the 'list_subsidies' tool. Parses input arguments using ListSubsidiesSchema, constructs API query parameters for searching subsidies, fetches data from the jGrants API, and returns the response as structured content or an error message.case "list_subsidies": { const args = ListSubsidiesSchema.parse(request.params.arguments ?? {}); const params = new URLSearchParams({ keyword: args.keyword, sort: "acceptance_end_datetime", order: "ASC", acceptance: "1", }); try { const response = await fetch(`${API_BASE_URL}/subsidies?${params}`); if (!response.ok) { const errorBody = await response.text(); throw new Error(`API error: ${response.status} - ${errorBody}`); } const data = (await response.json()) as SubsidyListResponse; return { content: [ { type: "text", text: JSON.stringify(data, null, 2), }, ], structuredContent: data, }; } catch (error) { return { content: [ { type: "text", text: `Error occurred: ${ error instanceof Error ? error.message : "Unknown error" }`, }, ], }; } }
- index.ts:19-21 (schema)Zod schema defining the input for the 'list_subsidies' tool, with an optional 'keyword' parameter defaulting to '補助金'.const ListSubsidiesSchema = z.object({ keyword: z.string().default("補助金"), });
- index.ts:54-68 (registration)Registration of the 'list_subsidies' tool in the ListToolsRequestHandler response, providing name, description, and input schema.{ name: "list_subsidies", description: "Search for subsidies currently accepting applications using the specified keyword. Default is '補助金' (subsidy).", inputSchema: { type: "object", properties: { keyword: { type: "string", description: "Search keyword", default: "補助金", }, }, }, },