list_subsidies
Search for subsidies currently accepting applications using a specified keyword. Access funding opportunities directly via the jgrants-mcp server with default search for '補助金' (subsidy).
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)The handler for the 'list_subsidies' tool. Parses input schema, queries the jGrants API for subsidies matching the keyword (default '補助金'), filters for currently accepting applications, and returns the JSON response.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 input validation schema for the 'list_subsidies' tool, defining an optional 'keyword' string parameter defaulting to '補助金' (subsidy).const ListSubsidiesSchema = z.object({ keyword: z.string().default("補助金"), });
- index.ts:54-68 (registration)Tool registration metadata provided in response to ListToolsRequest, including name, description, and input schema definition.{ 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: "補助金", }, }, }, },