builtins

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package builtins provides Starlark builtin functions for the script engine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(
	ctx context.Context, tools []ToolDef, stepLimit uint64, parallelMax int,
) starlark.StringDict

Build creates all Starlark globals for the script environment.

The returned globals include:

  • Tool callables by sanitized name (e.g., github_fetch_prs)
  • call_tool("name", ...) for name-based dispatch
  • parallel([fn1, fn2, ...]) for concurrent fan-out

The caller can check for key existence in the returned globals to prevent data arguments from shadowing builtins or tools.

Types

type ToolDef

type ToolDef struct {
	Name        string
	Description string
	Call        func(ctx context.Context, arguments map[string]interface{}) (*mcp.CallToolResult, error)
}

ToolDef defines a tool for the script environment.

Jump to

Keyboard shortcuts

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