get_backstage_examples
Retrieve code examples and samples for Backstage development scenarios including plugins, catalog, templates, and configuration to accelerate framework customization.
Instructions
Get code examples and samples for common Backstage development scenarios
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | Type of example to retrieve (optional) | |
| specific | No | Specific example within the type (optional) |
Implementation Reference
- src/index.ts:271-289 (handler)The main handler function that implements the core logic of the 'get_backstage_examples' tool. It extracts example content from the knowledge base, filters by optional 'type' and 'specific' parameters, and returns it as formatted JSON text.private getBackstageExamples(type?: string, specific?: string) { let content = this.knowledgeBase.examples.content; if (type) { content = content[type]; if (specific && content[specific]) { content = content[specific]; } } return { content: [ { type: 'text', text: JSON.stringify(content, null, 2), }, ], }; }
- src/index.ts:109-121 (schema)Input schema for the 'get_backstage_examples' tool, defining optional 'type' (enum) and 'specific' (string) parameters for filtering examples.inputSchema: { type: 'object', properties: { type: { type: 'string', description: 'Type of example to retrieve (optional)', enum: ['pluginExamples', 'catalogExamples', 'templateExamples', 'configExamples'] }, specific: { type: 'string', description: 'Specific example within the type (optional)' } }
- src/index.ts:106-123 (registration)Registration of the 'get_backstage_examples' tool in the ListTools response, including name, description, and input schema.{ name: 'get_backstage_examples', description: 'Get code examples and samples for common Backstage development scenarios', inputSchema: { type: 'object', properties: { type: { type: 'string', description: 'Type of example to retrieve (optional)', enum: ['pluginExamples', 'catalogExamples', 'templateExamples', 'configExamples'] }, specific: { type: 'string', description: 'Specific example within the type (optional)' } } } },
- src/index.ts:186-187 (registration)Registration of the tool handler in the CallToolRequest switch statement, dispatching calls to the getBackstageExamples method.case 'get_backstage_examples': return this.getBackstageExamples(args?.type as string, args?.specific as string);