find_resource
Search for specific resource types within Godot projects to locate assets like ShaderMaterial files across indexed content.
Instructions
Find resources by type across the indexed project.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | Resource type to search for (e.g. 'ShaderMaterial') | |
| maxResults | No | Maximum results to return |
Implementation Reference
- src/tools/resource-tools.ts:32-49 (handler)Handler for the find_resource tool which queries the resourceIndex by type.
handler: async (ctx) => { const { type, maxResults = 50 } = ctx.args; const results = await index.resourceIndex.findByType(type); const truncated = results.length > maxResults; const data = results.slice(0, maxResults).map((r) => ({ filePath: r.filePath, type: r.type, properties: Object.keys(r.properties), externalDeps: r.externalDeps, })); return makeTextResponse({ data, truncated, totalCount: results.length, metadata: { source: "index" }, }); }, - src/tools/resource-tools.ts:21-31 (schema)Input schema for find_resource defining type and maxResults parameters.
schema: { type: z.string().describe("Resource type to search for (e.g. 'ShaderMaterial')"), maxResults: z .number() .int() .min(1) .max(500) .optional() .default(50) .describe("Maximum results to return"), }, - src/tools/resource-tools.ts:18-20 (registration)Tool registration for find_resource in createResourceTools.
{ name: "find_resource", description: "Find resources by type across the indexed project.",