tools

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package tools defines the MCP tools exposed by abs-mcp, split by the resource they act on (server.go, libraries.go, items.go, ...). Tools are named resource-first (library_*, item_*, me_*) so they group by what they act on.

Every tool is registered through add with a kind: read tools never change server state, write tools do (and are dropped under --read-only), and delete tools remove library records or files (and are only registered with --enable-delete). --allow-tools / --deny-tools further narrow the set.

Index

Constants

This section is empty.

Variables

View Source
var EssentialTools = []string{
	"library_list",
	"library_search",
	"library_items",
	"item_get",
	"item_chapters",
	"user_in_progress",
	"user_progress_get",
	"user_progress_set",
}

EssentialTools is the curated preset selected by --allow-tools essential: enough to find things, read them, and keep listening progress in sync.

Functions

func RegisterAll

func RegisterAll(server *mcp.Server, client *abs.Client, opts Options) ([]string, error)

RegisterAll adds every tool permitted by opts to the MCP server and returns the names registered. It fails when an allow/deny pattern matches no tool, so a typo cannot silently hide one.

Types

type Options

type Options struct {
	// ReadOnly registers only tools that never change server state.
	ReadOnly bool
	// EnableDelete registers the tools that delete library items, podcast
	// episodes and authors. Off unless the operator opts in.
	EnableDelete bool
	// Allow, when set, restricts registration to matching tools: exact names,
	// prefix/suffix globs (library_*, *_delete) or the "essential" preset.
	Allow []string
	// Deny removes matching tools from whatever Allow left.
	Deny []string
}

Options controls which tools are registered.

Jump to

Keyboard shortcuts

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