Skip to main content
Glama
getschema.go1.6 kB
package templates import ( "context" "github.com/cyclops-ui/cyclops/cyclops-ctrl/api/v1alpha1" "github.com/mark3labs/mcp-go/mcp" ) func (t *TemplateController) getTemplateSchemaTool() mcp.Tool { return mcp.NewTool("get_template_schema", mcp.WithDescription("Returns JSON schema for the given template. Needs to be checked before calling create_module tool"), mcp.WithString("type", mcp.Required(), mcp.Description("Type of the Template"), mcp.Enum("git", "helm", "oci"), ), mcp.WithString("repo", mcp.Required(), mcp.Description("Template repo (Helm or Git repo)"), ), mcp.WithString("path", mcp.Required(), mcp.Description("In case of a git repo, folder of the template in the repository. For a helm chart, the name of the chart"), ), mcp.WithString("version", mcp.Required(), mcp.Description("Semantic version of the chart, or in case of a git repo can be a reference as commit hash or branch/tag"), ), mcp.WithString("icon", mcp.Description("Icon URL for the template"), ), ) } func (t *TemplateController) getTemplateSchema(_ context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { templateType := request.Params.Arguments["type"].(string) repo := request.Params.Arguments["repo"].(string) path := request.Params.Arguments["path"].(string) version := request.Params.Arguments["version"].(string) template, err := t.templateRepo.GetTemplate(repo, path, version, "", v1alpha1.TemplateSourceType(templateType)) if err != nil { return nil, err } return mcp.NewToolResultText(string(template.RawSchema)), nil }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/cyclops-ui/mcp-cyclops'

If you have feedback or need assistance with the MCP directory API, please join our Discord server