template_list
Discover available deployment templates to plan and initiate service setups on Railway, with search functionality to find specific templates by name or description.
Instructions
[API] List all available templates on Railway
⚡️ Best for: ✓ Discovering available templates ✓ Planning service deployments ✓ Finding template IDs and sources
⚠️ Not for: × Listing existing services × Getting service details
→ Alternatives: service_create_from_repo, service_create_from_image
→ Next steps: service_create_from_template
→ Related: database_list_types
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| searchQuery | No | Optional search query to filter templates by name and description |
Implementation Reference
- src/tools/template.tool.ts:6-32 (handler)Full implementation of the 'template_list' tool using createTool. Includes tool name, formatted description, input schema with optional searchQuery, and handler function that delegates to templatesService.listTemplates(searchQuery). This is the core handler logic for the tool.
createTool( "template_list", formatToolDescription({ type: 'API', description: "List all available templates on Railway", bestFor: [ "Discovering available templates", "Planning service deployments", "Finding template IDs and sources" ], notFor: [ "Listing existing services", "Getting service details" ], relations: { nextSteps: ["service_create_from_template"], alternatives: ["service_create_from_repo", "service_create_from_image"], related: ["database_list_types"] } }), { searchQuery: z.string().optional().describe("Optional search query to filter templates by name and description"), }, async ({ searchQuery }) => { return templatesService.listTemplates(searchQuery); } ), - src/tools/template.tool.ts:26-28 (schema)Input schema for template_list tool: optional searchQuery string to filter templates.
{ searchQuery: z.string().optional().describe("Optional search query to filter templates by name and description"), }, - src/tools/index.ts:16-37 (registration)Registration of all tools, including templateTools which contains the template_list tool. Imports templateTools and spreads into allTools, then registers each via server.tool(...).
export function registerAllTools(server: McpServer) { // Collect all tools const allTools = [ ...databaseTools, ...deploymentTools, ...domainTools, ...projectTools, ...serviceTools, ...tcpProxyTools, ...variableTools, ...configTools, ...volumeTools, ...templateTools, ] as Tool[]; // Register each tool with the server allTools.forEach((tool) => { server.tool( ...tool ); }); } - src/index.ts:20-20 (registration)Top-level call to registerAllTools on the MCP server instance, which registers the template_list tool.
registerAllTools(server);