Tools Reference

May 13, 2026 · View on GitHub

Complete reference for all tools, resources, and prompts available in the Logchef MCP server.

Tools

Profile & Metadata

ToolDescription
get_profileGet current user profile, including email, role, and API token info
get_teamsList teams you belong to with your role and member counts
get_metaServer version and configuration details

Source Management

ToolDescription
get_sourcesAll sources accessible to you, aggregated across all team memberships
get_team_sourcesSources belonging to a specific team

Log Querying

ToolDescription
query_logsExecute raw ClickHouse SQL against a log source (max 100 rows)
query_logchefqlExecute a LogchefQL query — simpler filter syntax (max 500 rows)
translate_logchefqlTranslate LogchefQL to ClickHouse SQL without executing
validate_logchefqlCheck LogchefQL syntax for errors without executing
get_source_schemaGet column names and ClickHouse types for a source
get_log_histogramTime-series histogram of log volume with optional grouping

Saved Queries

ToolDescription
list_saved_queriesList saved queries visible to the caller. Optionally filter by source_id
get_saved_queryGet a single saved query by ID
create_saved_querySave a new query bound to a source
update_saved_queryUpdate an existing saved query (creator-only)
delete_saved_queryDelete a saved query permanently (creator-only)

Investigation

ToolDescription
get_field_valuesTop distinct values for a field in a time range
get_log_contextSurrounding log entries before/after a timestamp
list_alertsAll alert rules configured for a source
get_alert_historyEvaluation history for a specific alert

Analysis

ToolDescription
compare_windowsRun the same query across two time windows and compare row counts
top_valuesGet top values for multiple fields in one call

Discovery

ToolDescription
generate_queryGenerate a ClickHouse SQL query from natural language (requires AI enabled on Logchef)
get_all_field_dimensionsGet top values for all LowCardinality fields in one call

Telemetry

ToolDescription
get_query_telemetryRecent query performance from ClickHouse system.query_log

Administration

ToolDescription
list_all_teamsList all teams (admin only)
get_teamGet team details
create_teamCreate a new team (admin only)
update_teamUpdate team name/description
delete_teamDelete a team permanently (admin only)
list_team_membersList members of a team
add_team_memberAdd a user to a team with a role
remove_team_memberRemove a user from a team
link_source_to_teamGrant a team access to a source
unlink_source_from_teamRevoke a team's access to a source
list_all_usersList all users (admin only)
get_userGet user details (admin only)
create_userCreate a user (admin only)
update_userUpdate user info (admin only)
delete_userDelete a user (admin only)
list_all_sourcesList all sources (admin only)
create_sourceCreate a ClickHouse log source (admin only)
validate_source_connectionTest ClickHouse connectivity (admin only)
delete_sourceDelete a source (admin only)
get_admin_source_statsClickHouse table stats — row count, sizes, compression (admin only)
list_api_tokensList your API tokens
create_api_tokenCreate a new API token
delete_api_tokenDelete an API token

Resources

Resources provide read-only data that AI assistants can access without explicit tool calls.

URI TemplateDescription
logchef://team/{team_id}/source/{source_id}/schemaClickHouse schema for a source
logchef://source/{source_id}/saved-queriesList of saved queries pinned to a source
logchef://saved-query/{query_id}A single saved query

Prompts

Prompts provide guided investigation workflows that instruct the AI assistant through multi-step analysis.

investigate_error_spike

Walk through error spike diagnosis: schema discovery, error volume assessment, pattern identification, timeline correlation, and root cause analysis.

Arguments:

  • team_id (required) — Team ID
  • source_id (required) — Source ID
  • time_range (optional) — e.g. "last 1h", defaults to last 1 hour

investigate_alert

Investigate a specific alert: review configuration, check evaluation history, reproduce the alert query, explore context, and summarize findings.

Arguments:

  • team_id (required) — Team ID
  • source_id (required) — Source ID
  • alert_id (required) — Alert ID

Tool Annotations

Every tool includes MCP annotations to help AI assistants understand safety:

  • Read-only tools (readOnlyHint: true): All query, list, and get operations
  • Non-destructive writes (destructiveHint: false): Create and update operations
  • Destructive operations (destructiveHint: true): Delete operations

AI assistants use these hints to decide when to ask for user confirmation before proceeding.