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 ¶
var EssentialTools = []string{
"library_list",
"library_search",
"library_items",
"item_get",
"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.
var Toolsets = map[string][]string{
"core": {
"server_info", "library_list", "library_search", "library_items", "item_get",
},
"listening": {
"user_get", "user_in_progress", "user_progress_get", "user_progress_set",
"user_progress_remove", "user_bookmarks", "user_bookmark_edit",
"user_history", "user_stats",
},
"curation": {
"audit_all", "audit_missing", "audit_unmatched", "audit_issues", "audit_no_audio",
"audit_podcast_no_episodes", "audit_chapters", "audit_authors",
"audit_path", "audit_covers", "audit_podcast_stale_feed",
"audit_duplicates", "audit_series", "audit_spelling", "audit_narrators", "audit_genres", "audit_unembedded", "audit_matched", "audit_abridged", "audit_whitespace", "metadata_rename",
"item_edit", "item_batch_edit", "item_match", "item_match_apply", "item_match_batch", "item_match_apply_batch", "item_match_tag", "item_compare_audio",
"item_cover_search", "item_cover_edit", "item_cover_upgrade", "item_chapters_set",
"author_list", "author_get", "author_edit", "author_match", "author_match_apply", "author_image_set",
"narrator_list", "series_list", "series_get", "series_edit", "series_merge",
"library_get", "library_filters", "library_recent", "server_tags",
},
"podcasts": {
"podcast_search", "podcast_add", "podcast_episodes", "podcast_episode_get",
"podcast_episode_edit", "podcast_feed_episodes", "podcast_episode_download",
"podcast_check_new", "podcast_downloads", "podcast_settings", "podcast_episode_delete",
},
"organise": {
"collection_list", "collection_get", "collection_create", "collection_edit",
"collection_books_edit", "collection_delete",
"playlist_list", "playlist_get", "playlist_create", "playlist_edit",
"playlist_entries_edit", "playlist_delete",
},
"admin": {
"server_sessions", "server_tasks", "server_backups", "server_backup_create",
"library_create", "library_edit", "library_scan", "library_issues_remove",
"item_rescan", "item_embed_metadata", "item_delete", "author_delete", "user_list",
},
}
Toolsets group the tools by the job someone is doing, so a client can load a working subset instead of all of them. The whole surface is around 12,000 tokens of tool definitions (name, description, input schema) before anyone has asked a question; core alone is about 1,000.
"all" is every tool, which is what the library does when no toolset is asked for; the abs-mcp binary defaults to core instead (see cli.FlagData.ToolOptions).
--toolsets also takes a resource family - item, podcast, library, user, audit, author, series, narrator, collection, playlist, server - which is every tool with that prefix. Those are derived from the registered names rather than listed here, so they cannot go stale.
Every tool belongs to exactly one set (TestToolsetsPartition proves it), and core is added to whatever else is asked for, because none of the other sets can find a library or open an item on their own.
Functions ¶
func FamilyNames ¶ added in v0.2.0
func FamilyNames() []string
FamilyNames lists the resource prefixes accepted by --toolsets, for help output.
func RegisterAll ¶
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.
func ToolsetNames ¶ added in v0.2.0
func ToolsetNames() []string
ToolsetNames lists the curated toolsets, for help output.
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
// Toolsets, when set, restricts registration to the named groups (see
// Toolsets). "core" is always included, so a set can be asked for on its
// own. Allow and Deny narrow whatever is left.
Toolsets []string
// 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
// ProviderTag is the prefix of the tag that records which store a match
// came from, "zz-provider:" by default; "off" writes and reads none.
ProviderTag string
// Providers is the default order of metadata providers to ask when a call
// names none: the store the books were bought from first, then the rest,
// [audible.ca, audible]. Empty means the library's own provider alone.
Providers []string
}
Options controls which tools are registered.
Source Files
¶
- all_tools.go
- audit.go
- audit_abridged.go
- audit_authors.go
- audit_chapters.go
- audit_covers.go
- audit_embedded.go
- audit_genres.go
- audit_matched.go
- audit_matched_fields.go
- audit_narrators.go
- audit_path.go
- audit_series.go
- audit_whitespace.go
- catalog.go
- collections.go
- common.go
- compare_audio.go
- cover_banner.go
- cover_hash.go
- duplicate_candidates.go
- duplicate_incomplete.go
- items.go
- libraries.go
- locks.go
- match_batch.go
- match_keep.go
- match_provider_tag.go
- match_score.go
- match_smart.go
- names_joined.go
- playlists.go
- podcasts.go
- series_folders.go
- series_numbering.go
- series_titles.go
- server.go
- spelling.go
- spelling_detect.go
- summary.go
- users.go
- visible.go