tools

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package tools implements MCP tool handlers for mtb.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrResult

func ErrResult[T any](msg string) (*mcp.CallToolResult, T, error)

ErrResult returns an MCP error result with the given message.

Types

type DepsInput

type DepsInput struct {
	Path    string `json:"path" jsonschema:"path to directory to scan for dependencies"`
	Details *bool  `json:"details,omitempty" jsonschema:"include line count and complexity per dependency from scc (default false)"`
}

type DepsOutput

type DepsOutput struct {
	PackageCount int           `json:"packageCount"`
	Packages     []PackageInfo `json:"packages"`
}

type LanguageSummary

type LanguageSummary struct {
	Name       string `json:"Name"`
	Bytes      int64  `json:"Bytes"`
	Lines      int64  `json:"Lines"`
	Code       int64  `json:"Code"`
	Comment    int64  `json:"Comment"`
	Blank      int64  `json:"Blank"`
	Complexity int64  `json:"Complexity"`
	Count      int64  `json:"Count"`
}

type PackageInfo

type PackageInfo struct {
	Name     string       `json:"name"`
	Version  string       `json:"version"`
	Type     string       `json:"type"`
	Language string       `json:"language,omitempty"`
	Location string       `json:"location,omitempty"`
	Analysis *StatsOutput `json:"analysis,omitempty"`
}

type RepoResult

type RepoResult struct {
	Name        string   `json:"name"`
	FullName    string   `json:"fullName"`
	Description string   `json:"description,omitempty"`
	URL         string   `json:"url"`
	Stars       int      `json:"stars"`
	Language    string   `json:"language,omitempty"`
	Topics      []string `json:"topics,omitempty"`
	UpdatedAt   string   `json:"updatedAt"`
}

type SearchInput

type SearchInput struct {
	Query      string `json:"query" jsonschema:"search query describing what you need (e.g. 'json schema validator python')"`
	Language   string `json:"language,omitempty" jsonschema:"filter by programming language (e.g. 'go', 'python', 'javascript')"`
	MaxResults *int   `json:"max_results,omitempty" jsonschema:"maximum number of results to return (default 10, max 25)"`
}

type SearchOutput

type SearchOutput struct {
	TotalCount int          `json:"totalCount"`
	Results    []RepoResult `json:"results"`
}

type StatsInput

type StatsInput struct {
	Path              string   `json:"path" jsonschema:"path to directory or file to analyze"`
	Cocomo            *bool    `json:"cocomo,omitempty" jsonschema:"include COCOMO cost estimates (default true)"`
	Complexity        *bool    `json:"complexity,omitempty" jsonschema:"include complexity metrics (default true)"`
	ExcludeDir        []string `json:"exclude_dir,omitempty" jsonschema:"directories to exclude from analysis"`
	ExcludeExtensions []string `json:"exclude_ext,omitempty" jsonschema:"file extensions to exclude (e.g. min.js)"`
	IncludeExtensions []string `json:"include_ext,omitempty" jsonschema:"only include these file extensions"`
}

type StatsOutput

type StatsOutput struct {
	LanguageSummary         []LanguageSummary `json:"languageSummary"`
	EstimatedCost           float64           `json:"estimatedCost"`
	EstimatedScheduleMonths float64           `json:"estimatedScheduleMonths"`
	EstimatedPeople         float64           `json:"estimatedPeople"`
}

func RunSCC

func RunSCC(absPath string, cocomo, complexity bool, excludeDir, excludeExt, includeExt []string) (*StatsOutput, error)

RunSCC runs scc on the given absolute path and returns analysis results.

Jump to

Keyboard shortcuts

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