|
| 1 | +const { z } = require('zod') |
| 2 | + |
| 3 | +module.exports = [ |
| 4 | + { |
| 5 | + name: 'platform_search_team_resources', |
| 6 | + title: 'Search Team Resources', |
| 7 | + description: `FlowFuse platform automation tool: |
| 8 | + Searches across a team's resources: applications, hosted instances, and remote instances (devices). |
| 9 | + Use this when the user wants to find something by name across the whole team, or when you have a name |
| 10 | + but not the ID of the resource you need. |
| 11 | + An empty or blank query returns an empty result set. |
| 12 | + To search only instances (hosted and remote), use platform_search_instances instead.`, |
| 13 | + annotations: { readOnlyHint: true, destructiveHint: false }, |
| 14 | + inputSchema: { |
| 15 | + teamId: z.string().describe('The ID or hashid of the team to search within'), |
| 16 | + query: z.string().describe('The search term') |
| 17 | + }, |
| 18 | + handler: async (args, { inject }) => { |
| 19 | + const response = await inject({ method: 'GET', url: `/api/v1/search?team=${args.teamId}&query=${encodeURIComponent(args.query)}` }) |
| 20 | + return response |
| 21 | + } |
| 22 | + }, |
| 23 | + { |
| 24 | + name: 'platform_search_instances', |
| 25 | + title: 'Search Instances', |
| 26 | + description: `FlowFuse platform automation tool: |
| 27 | + Searches the hosted instances and remote instances (devices) of a team. |
| 28 | + Use this when the user wants to find an instance by name and you do not already have its ID. |
| 29 | + An empty or blank query returns an empty result set. |
| 30 | + To search across all resource types (including applications), use platform_search_team_resources instead.`, |
| 31 | + annotations: { readOnlyHint: true, destructiveHint: false }, |
| 32 | + inputSchema: { |
| 33 | + teamId: z.string().describe('The ID or hashid of the team to search within'), |
| 34 | + query: z.string().describe('The search term') |
| 35 | + }, |
| 36 | + handler: async (args, { inject }) => { |
| 37 | + const response = await inject({ method: 'GET', url: `/api/v1/search/instances?team=${args.teamId}&query=${encodeURIComponent(args.query)}` }) |
| 38 | + return response |
| 39 | + } |
| 40 | + } |
| 41 | +] |
0 commit comments