Documentation
¶
Overview ¶
Package tools defines the MCP tools exposed by dockhand-mcp, split by the resource they act on (server.go, env.go, ...). Tools are named resource-first (server_*, env_*, container_*, stack_*, audit_*) so they group by what they act on.
One process works on one Dockhand, and a Dockhand on several Docker hosts, its environments. A tool that is about a host takes it as its env argument, by name or number: a read asks every environment unless one is named and sets the answers side by side, and a change is made on one named environment at a time.
Every tool is registered through add with a kind: read tools never change what Dockhand or a host holds, write tools do and are only registered with --enable-write, and delete tools remove what cannot be put back and are only registered with --enable-delete as well. A session reads until it is told it may do more: these are the machines things run on, and a wrong change stops them. --toolsets picks the groups a session needs, and --allow-tools / --deny-tools narrow the set further.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var EssentialTools = []string{
"server_info",
"env_list",
"container_list",
"container_logs",
}
EssentialTools is the curated preset selected by --allow-tools essential: enough to see what the Dockhand is, which hosts it manages, what runs on them and what a container has written.
var ToolsetOrder = []string{mcpregistry.Core, "audit", "manage", "containers", "files", "updates", "stacks", "resources", "setup", "schedules", "registries", "notifications", "vulnerabilities", "users", "settings", "secrets", "backups", "git", "templates", "tags"}
ToolsetOrder is the order a listing shows the sets in: the base first.
var Toolsets = map[string][]string{ mcpregistry.Core: { "server_info", "env_list", "container_list", "container_get", "container_logs", "stack_list", "stack_logs", "job_get", }, "audit": { "audit_all", "audit_health", "audit_hosts", "audit_stacks", "audit_healthcheck", "audit_restart_policy", "audit_updates", "audit_vulnerabilities", "audit_security", "audit_image_tags", "audit_limits", "audit_stopped", "audit_unused", }, "manage": { "container_start", "container_stop", "container_restart", "stack_start", "stack_stop", "stack_restart", "job_cancel", }, "containers": { "container_stats", "container_sizes", "container_top", "container_compose", "container_events", "container_create", "container_edit", "container_limits", "container_pause", "container_unpause", "container_rename", "container_exec", "container_delete", "container_prune", "container_events_clear", }, "files": { "container_files", "container_read", "container_file_download", "container_file_write", "container_file_upload", "container_file_mkdir", "container_file_move", "container_file_perms", "container_file_delete", }, "updates": { "container_updates", "container_autoupdate", "container_update", "container_autoupdate_set", "container_updates_clear", }, "stacks": { "stack_get", "stack_validate", "stack_deploys", "stack_scan", "server_files", "server_read", "stack_create", "stack_edit", "stack_deploy", "stack_down", "stack_adopt", "stack_move", "server_mkdir", "stack_delete", "stack_deploys_delete", }, "resources": { "env_disk", "image_list", "image_get", "image_export", "image_pull", "image_tag", "image_load", "image_delete", "image_prune", "volume_list", "volume_get", "volume_files", "volume_read", "volume_export", "volume_create", "volume_clone", "volume_delete", "volume_prune", "network_list", "network_get", "network_create", "network_connect", "network_disconnect", "network_delete", "network_prune", }, "setup": { "env_get", "env_test", "agent_list", "env_create", "env_edit", "env_schedules", "agent_token_create", "env_delete", "agent_token_delete", }, "schedules": { "schedule_list", "schedule_history", "schedule_run", "schedule_set", "schedule_delete", "schedule_history_delete", }, "registries": { "registry_list", "registry_test", "registry_images", "registry_tags", "registry_create", "registry_edit", "image_push", "registry_delete", "registry_image_delete", }, "notifications": { "notification_list", "notification_test", "notification_create", "notification_edit", "notification_link", "notification_link_delete", "notification_delete", }, "vulnerabilities": { "scanner_get", "vulnerability_list", "vulnerability_export", "image_scan_get", "scanner_set", "image_scan", "image_scan_all", "scanner_delete", "scanner_cache_clear", }, "users": { "user_list", "login_get", "token_list", "sso_list", "user_create", "user_edit", "login_set", "sso_create", "sso_edit", "user_delete", "sso_delete", }, "settings": { "settings_get", "preferences_get", "favorite_list", "server_update_check", "server_about", "settings_set", "preferences_set", "favorite_set", }, "secrets": { "secret_provider_list", "secret_provider_test", "secret_provider_keys", "secret_provider_create", "secret_provider_edit", "secret_provider_delete", }, "backups": { "backup_destination_list", "backup_destination_test", "backup_destination_check", "backup_list", "backup_snapshot_list", "backup_snapshot_get", "backup_snapshot_files", "backup_snapshot_read", "backup_snapshot_diff", "backup_snapshot_download", "backup_destination_create", "backup_destination_edit", "backup_destination_task", "backup_destination_rotate_key", "backup_create", "backup_edit", "backup_run", "backup_stop", "backup_restore", "backup_destination_delete", "backup_delete", "backup_snapshot_delete", }, "git": { "git_credential_list", "git_repository_list", "git_repository_test", "git_repository_variables", "git_stack_list", "git_stack_get", "git_credential_create", "git_credential_edit", "git_repository_create", "git_repository_edit", "git_stack_create", "git_stack_edit", "git_stack_sync", "git_stack_deploy", "git_credential_delete", "git_repository_delete", "git_stack_delete", }, "templates": { "template_list", "template_get", "template_source_list", "config_set_list", "template_source_create", "template_source_edit", "config_set_create", "config_set_edit", "template_source_delete", "config_set_delete", }, "tags": { "tag_list", "label_list", "icon_list", "icon_search", "icon_download", "tag_create", "tag_edit", "tag_assign", "label_edit", "label_assign", "icon_set", "tag_delete", "label_delete", "icon_delete", }, }
Toolsets group the tools by the job someone is doing, so a client can load a working subset instead of all of them: every tool's definition (name, description, input schema) is spent from a client's context before anyone has asked a question.
"all" is every tool, which is what the library does when no toolset is asked for; the dockhand-mcp binary defaults to core and audit instead (see cli.FlagData.ToolOptions).
--toolsets also takes a resource family - server, env, container, stack - 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 say which hosts there are on their own.
Functions ¶
func FamilyNames ¶
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 ¶
func ToolsetNames() []string
ToolsetNames lists the curated toolsets, for help output.
Types ¶
type Options ¶
type Options struct {
// EnableWrite registers the tools that change something. Off unless the operator opts in: with nothing said, a session can only read.
EnableWrite bool
// EnableDelete registers the tools that delete. A delete is a change, so it needs EnableWrite too, and is refused without it rather than quietly
// registering nothing.
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 adds to them and Deny takes away.
Toolsets []string
// Allow names tools to register: exact names, prefix/suffix globs (container_*, *_delete) or the "essential" preset. Beside Toolsets it adds
// those tools to the sets, wherever they belong: the sets plus these. With no Toolsets it is the whole choice, and only the tools it names are
// registered, core not among them unless named. A name or pattern that matches no tool is refused rather than registering nothing.
Allow []string
// Deny removes matching tools from whatever the two above chose: it is how a set is narrowed.
Deny []string
// contains filtered or unexported fields
}
Options controls which tools are registered.
type ToolInfo ¶
type ToolInfo = mcpregistry.Info
ToolInfo describes a registered tool without a server to register it on.
Source Files
¶
- actions.go
- agent.go
- all_tools.go
- ask.go
- audit.go
- audit_checks.go
- backup.go
- backup_destination.go
- backup_snapshot.go
- config_set.go
- container.go
- container_change.go
- container_events.go
- container_file.go
- container_get.go
- container_inside.go
- container_make.go
- container_updates.go
- env.go
- env_disk.go
- env_host.go
- env_write.go
- export.go
- find.go
- git.go
- git_stack.go
- icon.go
- image.go
- job.go
- label.go
- logs.go
- network.go
- notification.go
- preference.go
- registry.go
- schedule.go
- secret_provider.go
- secrets.go
- server.go
- server_about.go
- server_files.go
- settings.go
- sso.go
- stack.go
- stack_get.go
- stack_write.go
- tag.go
- template.go
- user.go
- volume.go
- vulnerability.go