Skip to content

MCP Tools Reference

Complete reference for all MCP protocol tools exposed by MCP Hangar. These tools are callable by any MCP client (Claude Desktop, LM Studio, custom integrations).

Quick Reference

ToolCategoryDescriptionSide Effects
hangar_listLifecycleList all providers with state and tool countsNone (read-only)
hangar_startLifecycleStart a provider or groupStarts process/container
hangar_stopLifecycleStop a provider or groupStops process/container
hangar_statusLifecycleHuman-readable health dashboardNone (read-only)
hangar_reload_configLifecycleReload configuration from diskStops/starts providers
hangar_loadHot-LoadingLoad provider from registry at runtimeDownloads and starts provider
hangar_unloadHot-LoadingUnload a hot-loaded providerStops and removes provider
hangar_toolsProviderList tools available on a providerMay start cold provider
hangar_detailsProviderDetailed provider or group informationNone (read-only)
hangar_warmProviderPre-start providers for faster first callStarts provider processes
hangar_healthHealthSystem-wide health summaryNone (read-only)
hangar_metricsHealthProvider metrics in JSON or Prometheus formatNone (read-only)
hangar_discoverDiscoveryTrigger discovery scan across all sourcesUpdates pending provider list
hangar_discoveredDiscoveryList pending discovered providersNone (read-only)
hangar_quarantineDiscoveryList quarantined providersNone (read-only)
hangar_approveDiscoveryApprove a pending or quarantined providerRegisters provider
hangar_sourcesDiscoveryList discovery source statusNone (read-only)
hangar_group_listGroupsList all provider groups with member detailsNone (read-only)
hangar_group_rebalanceGroupsRebalance group membership and reset circuit breakerRe-checks members, resets circuit
hangar_callBatch and ContinuationInvoke tools on providers (single or batch)May start cold providers
hangar_fetch_continuationBatch and ContinuationFetch truncated response dataNone (read-only)
hangar_delete_continuationBatch and ContinuationDelete cached continuation dataRemoves cached response

Lifecycle

hangar_list

List all configured providers, groups, and runtime (hot-loaded) providers with current state, mode, and tool counts.

Parameters:

ParameterTypeDefaultDescription
state_filterstr | NoneNoneFilter by state: "cold", "ready", "degraded", "dead"

Side Effects: None (read-only).

Returns:

FieldTypeDescription
providerslist[object]Configured providers with provider, state, mode, alive, tools_count, health_status, tools_predefined, description
groupslist[object]Groups with group_id, state, strategy, healthy_count, total_members
runtime_providerslist[object]Hot-loaded providers with provider, state, source, verified, ephemeral, loaded_at, lifetime_seconds

Example:

json
// Request
{"state_filter": "ready"}

// Response
{
  "providers": [
    {"provider": "math", "state": "ready", "mode": "subprocess", "alive": true,
     "tools_count": 4, "health_status": "healthy", "tools_predefined": false}
  ],
  "groups": [],
  "runtime_providers": []
}

hangar_start

Start a provider or group. Transitions the provider from COLD to READY.

Parameters:

ParameterTypeDefaultDescription
providerstrrequiredProvider ID or Group ID

Side Effects: Starts provider process or container. State transitions from COLD to READY.

Returns:

For a provider:

FieldTypeDescription
providerstrProvider ID
statestrNew state (typically "ready")
toolslist[str]Available tool names

For a group:

FieldTypeDescription
groupstrGroup ID
statestrGroup state
members_startedintNumber of members started
healthy_countintHealthy member count
total_membersintTotal member count

Example:

json
// Request
{"provider": "math"}

// Response
{"provider": "math", "state": "ready", "tools": ["add", "subtract", "multiply", "divide"]}

Errors: ValueError("unknown_provider: <id>"), ValueError("unknown_group: <id>")

hangar_stop

Stop a running provider or group.

Parameters:

ParameterTypeDefaultDescription
providerstrrequiredProvider ID or Group ID

Side Effects: Stops provider process or container. State transitions to COLD.

Returns:

For a provider:

FieldTypeDescription
stoppedstrProvider ID
reasonstrStop reason

For a group:

FieldTypeDescription
groupstrGroup ID
statestrGroup state
stoppedbooltrue

Example:

json
// Request
{"provider": "math"}

// Response
{"stopped": "math", "reason": "manual_stop"}

Errors: ValueError("unknown_provider: <id>")

hangar_status

Human-readable health dashboard with state indicators for all providers and groups.

Parameters: None.

Side Effects: None (read-only).

Returns:

FieldTypeDescription
providerslist[object]Providers with id, indicator, state, mode, last_used
groupslist[object]Groups with id, indicator, state, healthy_members, total_members
runtime_providerslist[object]Hot-loaded providers with id, indicator, state, source, verified
summaryobjectCounts: healthy_providers, total_providers, runtime_providers, runtime_healthy, uptime, uptime_seconds
formattedstrPre-formatted text dashboard

Indicator values: [READY], [COLD], [STARTING], [DEGRADED], [DEAD].

Example:

json
// Request
{}

// Response
{
  "providers": [
    {"id": "math", "indicator": "[READY]", "state": "ready", "mode": "subprocess"}
  ],
  "groups": [],
  "runtime_providers": [],
  "summary": {"healthy_providers": 1, "total_providers": 1, "uptime": "2h 15m"},
  "formatted": "[READY] math (subprocess, 4 tools)"
}

hangar_reload_config

Reload configuration from disk, applying provider additions, removals, and updates.

Parameters:

ParameterTypeDefaultDescription
gracefulbooltrueWait for idle before stopping modified/removed providers

Side Effects: Stops removed/modified providers, registers new providers, updates changed providers.

Returns:

FieldTypeDescription
statusstr"success" or "failed"
messagestrHuman-readable result description
providers_addedlist[str]Newly added provider IDs
providers_removedlist[str]Removed provider IDs
providers_updatedlist[str]Updated provider IDs
providers_unchangedlist[str]Unchanged provider IDs
duration_msfloatReload duration in milliseconds

On failure, the response includes error_type instead of provider lists.

Example:

json
// Request
{"graceful": true}

// Response
{
  "status": "success", "message": "Configuration reloaded",
  "providers_added": ["new-api"], "providers_removed": [],
  "providers_updated": ["math"], "providers_unchanged": ["filesystem"],
  "duration_ms": 45.2
}

Hot-Loading

hangar_load (async)

Load a provider from the MCP registry at runtime. Hot-loaded providers are ephemeral and lost on server restart.

Parameters:

ParameterTypeDefaultDescription
namestrrequiredRegistry name of the provider
force_unverifiedboolfalseLoad unverified providers without confirmation
allow_toolslist[str] | NoneNoneFnmatch patterns for allowed tools
deny_toolslist[str] | NoneNoneFnmatch patterns for denied tools

Side Effects: Downloads and starts the provider process. Adds to the runtime registry.

Returns:

The primary success response:

FieldTypeDescription
statusstr"loaded"
providerstrAssigned provider ID
toolslist[str]Available tool names

Other possible status values: "ambiguous" (multiple matches found, includes matches list), "not_found" (no match in registry), "missing_secrets" (required secrets not configured, includes missing list and instructions), "unverified" (provider not verified, use force_unverified to override), "failed" (configuration error).

Example:

json
// Request
{"name": "filesystem", "allow_tools": ["read_*"]}

// Response
{"status": "loaded", "provider": "filesystem", "tools": ["read_file", "read_directory"]}

hangar_unload

Unload a hot-loaded provider. Only works for providers loaded via hangar_load.

Parameters:

ParameterTypeDefaultDescription
providerstrrequiredProvider ID (from hangar_load result)

Side Effects: Stops the provider process and removes it from the runtime registry.

Returns:

FieldTypeDescription
statusstr"unloaded" or "not_hot_loaded" or "failed"
providerstrProvider ID
messagestrResult description
lifetime_secondsfloatHow long the provider was loaded (success only)

Example:

json
// Request
{"provider": "filesystem"}

// Response
{"status": "unloaded", "provider": "filesystem", "message": "Provider unloaded",
 "lifetime_seconds": 3600.5}

Provider

hangar_tools

List the tools available on a provider or group. Tool access filtering (allow_list/deny_list) is applied.

Parameters:

ParameterTypeDefaultDescription
providerstrrequiredProvider ID or Group ID

Side Effects: May start a cold provider to discover its tools.

Returns:

FieldTypeDescription
providerstrProvider ID
statestrProvider state
predefinedboolWhether tools are predefined (not discovered at runtime)
toolslist[object]Tools with name, description, inputSchema

For groups, the response includes group: true instead of predefined.

Example:

json
// Request
{"provider": "math"}

// Response
{
  "provider": "math", "state": "ready", "predefined": false,
  "tools": [
    {"name": "add", "description": "Add two numbers",
     "inputSchema": {"type": "object", "properties": {"a": {"type": "number"}, "b": {"type": "number"}}}}
  ]
}

Errors: ValueError("unknown_provider: <id>"), ValueError("no_healthy_members_in_group: <id>")

hangar_details

Detailed information about a provider or group, including health tracking, idle time, and tool access policy.

Parameters:

ParameterTypeDefaultDescription
providerstrrequiredProvider ID or Group ID

Side Effects: None (read-only).

Returns:

For a provider:

FieldTypeDescription
providerstrProvider ID
statestrCurrent state
modestrProvider mode
aliveboolWhether the provider process is running
toolslist[object]Tool list with schemas
healthobjectHealth tracking: consecutive_failures, last_check, etc.
idle_timefloat | NoneSeconds since last use
metaobjectProvider metadata
tools_policyobjectTool access policy: type, has_allow_list, has_deny_list, filtered_count

For a group:

FieldTypeDescription
group_idstrGroup ID
descriptionstr | NoneGroup description
statestrGroup state
strategystrLoad balancing strategy
min_healthyintMinimum healthy members
healthy_countintCurrent healthy member count
total_membersintTotal member count
is_availableboolWhether the group can accept requests
circuit_openboolWhether the circuit breaker is open
memberslist[object]Members with id, state, in_rotation, weight, priority, consecutive_failures

Example:

json
// Request
{"provider": "math"}

// Response
{
  "provider": "math", "state": "ready", "mode": "subprocess", "alive": true,
  "tools": [{"name": "add", "description": "Add two numbers"}],
  "health": {"consecutive_failures": 0, "last_check": "2026-01-15T10:30:00Z"},
  "idle_time": 45.2,
  "tools_policy": {"type": "open", "has_allow_list": false, "has_deny_list": false}
}

Errors: ValueError("unknown_provider: <id>")

hangar_warm

Pre-start one or more providers so the first tool call does not incur cold-start latency. Groups are skipped.

Parameters:

ParameterTypeDefaultDescription
providersstr | NoneNoneComma-separated provider IDs. None warms all providers.

Side Effects: Starts specified provider processes.

Returns:

FieldTypeDescription
warmedlist[str]Successfully warmed provider IDs
already_warmlist[str]Providers that were already running
failedlist[object]Failed providers with id and error
summarystrHuman-readable summary

Example:

json
// Request
{"providers": "math,filesystem"}

// Response
{
  "warmed": ["math"], "already_warm": ["filesystem"], "failed": [],
  "summary": "1 warmed, 1 already warm, 0 failed"
}

Health

hangar_health

System-wide health summary with provider state counts and security information.

Parameters: None.

Side Effects: None (read-only).

Returns:

FieldTypeDescription
statusstrOverall system status
providersobjecttotal and by_state breakdown (cold, ready, degraded, dead)
groupsobjecttotal, by_state, total_members, healthy_members
securityobjectRate limiting info: rate_limiting.active_buckets, rate_limiting.config

Example:

json
// Request
{}

// Response
{
  "status": "healthy",
  "providers": {"total": 3, "by_state": {"ready": 2, "cold": 1}},
  "groups": {"total": 1, "by_state": {"healthy": 1}, "total_members": 3, "healthy_members": 3},
  "security": {"rate_limiting": {"active_buckets": 0, "config": {"rps": 10, "burst": 20}}}
}

hangar_metrics

Provider metrics in JSON or Prometheus exposition format.

Parameters:

ParameterTypeDefaultDescription
formatstr"json"Output format: "json" or "prometheus"

Side Effects: None (read-only).

Returns (JSON format):

FieldTypeDescription
providersdict[str, object]Per-provider metrics: state, mode, tools_count, invocations, errors, avg_latency_ms
groupsdict[str, object]Per-group metrics: state, strategy, total_members, healthy_members
tool_callsdict[str, object]Per-tool metrics keyed by provider.tool: count, errors
discoveryobjectDiscovery metrics
errorsdict[str, int]Error counts by type
performanceobjectPerformance metrics
summaryobjectTotals: total_providers, total_groups, total_tool_calls, total_errors

When format is "prometheus", the response contains a single metrics field with Prometheus exposition text.

Example:

json
// Request
{"format": "json"}

// Response
{
  "providers": {"math": {"state": "ready", "mode": "subprocess", "tools_count": 4,
                          "invocations": 150, "errors": 2, "avg_latency_ms": 12.3}},
  "groups": {},
  "tool_calls": {"math.add": {"count": 100, "errors": 0}},
  "summary": {"total_providers": 1, "total_groups": 0, "total_tool_calls": 150, "total_errors": 2}
}

Discovery

hangar_discover (async)

Trigger a discovery scan across all enabled sources. Discovered providers are added to the pending list for approval (unless auto_register is enabled).

Parameters: None.

Side Effects: Scans all enabled discovery sources. Updates the pending provider list.

Returns:

FieldTypeDescription
discovered_countintTotal providers discovered
registered_countintProviders auto-registered
updated_countintExisting providers updated
deregistered_countintProviders deregistered (authoritative mode)
quarantined_countintProviders quarantined
error_countintDiscovery errors
duration_msfloatScan duration in milliseconds
source_resultsdict[str, int]Discovered count per source type

Returns {error: "Discovery not configured. Enable discovery in config.yaml"} when discovery is not enabled.

Example:

json
// Request
{}

// Response
{
  "discovered_count": 5, "registered_count": 3, "updated_count": 1,
  "deregistered_count": 0, "quarantined_count": 1, "error_count": 0,
  "duration_ms": 1250.0, "source_results": {"docker": 3, "filesystem": 2}
}

hangar_discovered

List providers discovered but not yet registered (pending approval).

Parameters: None.

Side Effects: None (read-only).

Returns:

FieldTypeDescription
pendinglist[object]Pending providers with name, source, mode, discovered_at, fingerprint

Returns {error: ...} when discovery is not configured.

Example:

json
// Request
{}

// Response
{
  "pending": [
    {"name": "new-api", "source": "docker", "mode": "remote",
     "discovered_at": "2026-01-15T10:30:00Z", "fingerprint": "abc123"}
  ]
}

hangar_quarantine

List providers that failed health checks during discovery and were quarantined.

Parameters: None.

Side Effects: None (read-only).

Returns:

FieldTypeDescription
quarantinedlist[object]Quarantined providers with name, source, reason, quarantine_time

Returns {error: ...} when discovery is not configured.

Example:

json
// Request
{}

// Response
{
  "quarantined": [
    {"name": "broken-api", "source": "docker", "reason": "health_check_failed",
     "quarantine_time": "2026-01-15T10:30:00Z"}
  ]
}

hangar_approve (async)

Approve a pending or quarantined provider for registration.

Parameters:

ParameterTypeDefaultDescription
providerstrrequiredProvider name from hangar_discovered or hangar_quarantine output

Side Effects: Registers the provider in COLD state. Removes from pending or quarantine list.

Returns:

FieldTypeDescription
approvedboolWhether approval succeeded
providerstrProvider name
statusstr"registered" on success
errorstrError message on failure

Returns {error: ...} when discovery is not configured.

Example:

json
// Request
{"provider": "new-api"}

// Response
{"approved": true, "provider": "new-api", "status": "registered"}

hangar_sources (async)

List the status of all configured discovery sources.

Parameters: None.

Side Effects: None (read-only).

Returns:

FieldTypeDescription
sourceslist[object]Sources with source_type, mode, is_healthy, is_enabled, last_discovery, providers_count, error_message

Returns {error: ...} when discovery is not configured.

Example:

json
// Request
{}

// Response
{
  "sources": [
    {"source_type": "docker", "mode": "additive", "is_healthy": true,
     "is_enabled": true, "last_discovery": "2026-01-15T10:30:00Z",
     "providers_count": 3, "error_message": null}
  ]
}

Groups

hangar_group_list

List all provider groups with member details, health state, and load balancing configuration.

Parameters: None.

Side Effects: None (read-only).

Returns:

FieldTypeDescription
groupslist[object]Groups with group_id, description, state, strategy, min_healthy, healthy_count, total_members, is_available, circuit_open, members

Each member in the members list contains: id, state, in_rotation, weight, priority, consecutive_failures.

Example:

json
// Request
{}

// Response
{
  "groups": [
    {
      "group_id": "llm-group", "description": "LLM pool", "state": "healthy",
      "strategy": "round_robin", "min_healthy": 1, "healthy_count": 2,
      "total_members": 2, "is_available": true, "circuit_open": false,
      "members": [
        {"id": "llm-1", "state": "ready", "in_rotation": true, "weight": 50,
         "priority": 1, "consecutive_failures": 0},
        {"id": "llm-2", "state": "ready", "in_rotation": true, "weight": 50,
         "priority": 2, "consecutive_failures": 0}
      ]
    }
  ]
}

hangar_group_rebalance

Rebalance a group by re-checking all members. Recovered members rejoin rotation, failed members are removed. Resets the circuit breaker.

Parameters:

ParameterTypeDefaultDescription
groupstrrequiredGroup ID

Side Effects: Re-checks all members. Updates rotation membership. Resets circuit breaker.

Returns:

FieldTypeDescription
group_idstrGroup ID
statestrGroup state after rebalance
healthy_countintHealthy member count
total_membersintTotal member count
members_in_rotationlist[str]Member IDs currently in rotation

Example:

json
// Request
{"group": "llm-group"}

// Response
{
  "group_id": "llm-group", "state": "healthy", "healthy_count": 2,
  "total_members": 2, "members_in_rotation": ["llm-1", "llm-2"]
}

Errors: ValueError("unknown_group: <id>")

Batch and Continuation

hangar_call

Invoke tools on MCP providers. Supports single calls and parallel batch execution with two-level concurrency control (per-batch and system-wide).

Parameters:

ParameterTypeDefaultRangeDescription
callslist[object]required1--100 itemsList of {provider, tool, arguments, timeout?} objects
max_concurrencyint101--50Parallel workers for this batch
timeoutfloat601--300Batch timeout in seconds
fail_fastboolfalse--Stop batch on first error
max_attemptsint11--10Total attempts per call including retries

Side Effects: May start cold providers. Executes tool calls on providers.

Returns:

FieldTypeDescription
batch_idstrUnique batch identifier
successbooltrue if all calls succeeded
totalintTotal calls in batch
succeededintSuccessful call count
failedintFailed call count
elapsed_msfloatTotal batch execution time
resultslist[object]Per-call results with index, call_id, success, result, error, error_type, elapsed_ms

On validation failure, the response contains validation_errors (list of {index, field, message}) instead of results. Individual results may include truncated: true with a continuation_id for large responses -- use hangar_fetch_continuation to retrieve the full data.

Results with retries include retry_metadata with attempts and retries counts.

Example:

json
// Request
{
  "calls": [
    {"provider": "math", "tool": "add", "arguments": {"a": 1, "b": 2}},
    {"provider": "math", "tool": "multiply", "arguments": {"a": 3, "b": 4}}
  ],
  "max_concurrency": 5
}

// Response
{
  "batch_id": "batch-abc123", "success": true, "total": 2,
  "succeeded": 2, "failed": 0, "elapsed_ms": 45.2,
  "results": [
    {"index": 0, "call_id": "call-1", "success": true, "result": 3,
     "error": null, "error_type": null, "elapsed_ms": 20.1},
    {"index": 1, "call_id": "call-2", "success": true, "result": 12,
     "error": null, "error_type": null, "elapsed_ms": 22.8}
  ]
}

hangar_fetch_continuation

Fetch full data for a truncated batch response. Continuation IDs are returned when individual call results exceed the response size limit.

Parameters:

ParameterTypeDefaultRangeDescription
continuation_idstrrequiredstarts with "cont_"Continuation ID from a truncated result
offsetint0>= 0Byte offset to start reading from
limitint5000001--2000000Maximum bytes to return

Side Effects: None (read-only cache access).

Returns:

FieldTypeDescription
foundboolWhether the continuation data exists
dataanyThe continuation data (when found)
total_size_bytesintTotal size of the cached data
offsetintCurrent read offset
has_moreboolWhether more data is available
completeboolWhether all data has been returned

Returns {found: false, error: "Continuation not found (may have expired)"} when the continuation ID is invalid or expired.

Example:

json
// Request
{"continuation_id": "cont_abc123", "offset": 0, "limit": 500000}

// Response
{
  "found": true, "data": "...full response content...",
  "total_size_bytes": 250000, "offset": 0, "has_more": false, "complete": true
}

Errors: ValueError if continuation_id is empty, does not start with "cont_", or offset is negative.

hangar_delete_continuation

Delete cached continuation data to free memory.

Parameters:

ParameterTypeDefaultDescription
continuation_idstrrequiredContinuation ID to delete

Side Effects: Removes the cached response from memory.

Returns:

FieldTypeDescription
deletedboolWhether the data was found and deleted
continuation_idstrThe requested continuation ID

Returns {deleted: false, continuation_id: "..."} when the ID is not found. Returns {deleted: false, continuation_id: "...", error: "..."} when the truncation cache is unavailable.

Example:

json
// Request
{"continuation_id": "cont_abc123"}

// Response
{"deleted": true, "continuation_id": "cont_abc123"}

Errors: ValueError if continuation_id is empty.

Released under the MIT License.