generator

package
v0.0.0-...-36324c4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildImportPath

func BuildImportPath(outputDir string) (string, error)

BuildImportPath finds the module root and builds the import path for mcptools

Types

type Generator

type Generator struct {
	PackageName string
	// contains filtered or unexported fields
}

func NewGenerator

func NewGenerator(specPath string, validation bool, packageName string, outputDir string) (*Generator, error)

func (*Generator) GenerateHTTPClient

func (g *Generator) GenerateHTTPClient(includes []string) error

func (*Generator) GenerateHelpers

func (g *Generator) GenerateHelpers() error

GenerateHelpers creates a helpers.go file with utility functions for MCP tools

func (*Generator) GenerateMCP

func (g *Generator) GenerateMCP() error

GenerateMCP generates the MCP tool files while preserving existing handler implementations and imports

func (*Generator) GenerateServerFile

func (g *Generator) GenerateServerFile(config *converter.MCPConfig) error

GenerateServerFile creates a server.go file in the same package as the tools

func (*Generator) GenerateToolFiles

func (g *Generator) GenerateToolFiles(config *converter.MCPConfig) error

GenerateToolFiles generates individual tool files while preserving existing handler implementations

type ToolTemplateData

type ToolTemplateData struct {
	ToolNameOriginal      string
	ToolNameGo            string
	ToolHandlerName       string
	ToolDescription       string
	RawInputSchema        string
	ResponseTemplate      []converter.ResponseTemplate
	InputSchemaConst      string
	ResponseTemplateConst string
}

ToolTemplateData holds the data to pass to the template for a single tool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL