Semaphor
MCP

Tools Reference

Complete reference for all Semaphor MCP tools, their parameters, and responses.

Semaphor MCP exposes 12 tools organized into two categories: discovery and query. All tools accept a response_format parameter ("json" or "markdown") to control output formatting.

Interactive Sessions

For interactive (OAuth) sessions, semaphor_list_projects is available for project discovery. Pass the chosen projectId explicitly on each project-scoped tool call.

Discovery Tools

semaphor_get_analysis_context

Bootstrap tool for data questions. Call this first to determine the recommended discovery path (semantic or physical).

Parameters:

ParameterTypeRequiredDefaultDescription
projectIdstringNoFrom sessionProject to analyze
response_formatenumNo"json""markdown" or "json"

Response fields: projectId, recommendedPath, recommendedNextTool, guidance, semanticDomains, fallbackConnections

Example
// Request
{ "name": "semaphor_get_analysis_context", "arguments": {} }

// Response (summarized)
{
  "projectId": "p_abc123",
  "recommendedPath": "semantic",
  "recommendedNextTool": "semaphor_list_semantic_domains",
  "semanticDomains": [
    { "id": "dom_abc", "name": "Sales Analytics", "datasetCount": 4 }
  ]
}

semaphor_get_access_context

Returns the active MCP session context, including user identity, organization, and project scope.

Parameters:

ParameterTypeRequiredDefaultDescription
response_formatenumNo"json""markdown" or "json"

Response fields: actorType, userId, organizationId, projectId, tenantId, authMethod, sessionBound

Example
// Response
{
  "actorType": "organization",
  "userId": "kp_abc123",
  "organizationId": "org_xyz",
  "projectId": "p_abc123",
  "authMethod": "project-token",
  "sessionBound": false
}

semaphor_list_projects

Lists all projects accessible to the authenticated user.

Only available in interactive (OAuth) sessions. Not available in embedded (project-token) sessions.

Parameters:

ParameterTypeRequiredDefaultDescription
response_formatenumNo"markdown""markdown" or "json"

Response fields: Array of projects with id, name, description, owner, createdAt

Use the returned projectId values to pass on subsequent project-scoped tool calls.


semaphor_list_dashboards

Lists dashboards accessible to the authenticated user in a specific project.

Parameters:

ParameterTypeRequiredDefaultDescription
projectIdstringYes—Project ID
searchstringNo—Search by title or description
limitintegerNo100Max results (1-500)
offsetintegerNo0Pagination offset
response_formatenumNo"markdown""markdown" or "json"

Response fields: Array of dashboards with id, title, description, createdAt, updatedAt

Example
// Request
{
  "name": "semaphor_list_dashboards",
  "arguments": { "projectId": "p_abc123", "search": "sales" }
}

semaphor_get_dashboard_details

Returns detailed information about a specific dashboard.

Parameters:

ParameterTypeRequiredDefaultDescription
dashboardIdstringYes—Dashboard ID
include_templatebooleanNofalseInclude full dashboard configuration
response_formatenumNo"markdown""markdown" or "json"

Response fields: id, title, description, sheets, cards, createdAt, updatedAt, and optionally template (full JSON configuration)


semaphor_list_semantic_domains

Lists semantic domains available in the project. Call this when the analysis context recommends the semantic path.

Parameters:

ParameterTypeRequiredDefaultDescription
projectIdstringNoFrom sessionProject ID
response_formatenumNo"markdown""markdown" or "json"

Response fields: Array of domains with id, name, description, connectionId, datasetCount

Example
// Response
{
  "domains": [
    {
      "id": "dom_abc",
      "name": "Sales Analytics",
      "description": "Customer orders and revenue data",
      "connectionId": "conn_123",
      "datasetCount": 4
    }
  ]
}

semaphor_list_datasets

Lists datasets within a semantic domain. Call this after semaphor_list_semantic_domains and before semaphor_get_dataset_schema.

Parameters:

ParameterTypeRequiredDefaultDescription
projectIdstringNoFrom sessionProject ID
domainIdstringYes—Semantic domain ID
response_formatenumNo"json""markdown" or "json"

Response fields: Array of datasets with name, label, description, type (physical or virtual), and analyticsRole when authored.

Example
// Request
{
  "name": "semaphor_list_datasets",
  "arguments": { "domainId": "dom_abc" }
}

// Response
{
  "datasets": [
    { "name": "orders", "label": "Orders", "description": "Customer orders" },
    { "name": "customers", "label": "Customers", "description": "Customer profiles" }
  ]
}

semaphor_get_dataset_schema

Returns columns for a semantic dataset or physical table. Supports two usage patterns.

Semantic mode (preferred): Pass domainId and datasetName.

Physical mode: Pass connectionId and tableName (with optional databaseName and schemaName).

Parameters:

ParameterTypeRequiredDefaultDescription
projectIdstringNoFrom sessionProject ID
domainIdstringNo—Semantic domain ID (semantic mode)
datasetNamestringNo—Dataset name from list_datasets (semantic mode)
connectionIdstringNo—Connection ID (physical mode)
connectionNamestringNo—Connection name (physical mode, alternative to ID)
databaseNamestringNo—Database name (physical mode)
schemaNamestringNo—Schema name (physical mode)
tableNamestringNo—Table name (physical mode)
includeCalculatedFieldsbooleanNotrueInclude calculated fields in results
response_formatenumNo"json""markdown" or "json"

Response fields: Array of columns with name, label, type, fieldType (dimension or measure), description, and metric aggregate metadata when authored.

Semantic mode example
{
  "name": "semaphor_get_dataset_schema",
  "arguments": { "domainId": "dom_abc", "datasetName": "orders" }
}
Physical mode example
{
  "name": "semaphor_get_dataset_schema",
  "arguments": {
    "connectionId": "conn_123",
    "schemaName": "public",
    "tableName": "orders"
  }
}

semaphor_list_connections

Lists database connections accessible in the active project. Use this only when the semantic path is unavailable.

Parameters:

ParameterTypeRequiredDefaultDescription
projectIdstringNoFrom sessionProject ID
response_formatenumNo"json""markdown" or "json"

Response fields: Array of connections with id, name, type (postgres, mysql, bigquery, etc.)


semaphor_get_domain_relationships

Returns join relationships between datasets in a semantic domain. Useful for multi-dataset queries.

Parameters:

ParameterTypeRequiredDefaultDescription
projectIdstringNoFrom sessionProject ID
domainIdstringYes—Semantic domain ID
response_formatenumNo"json""markdown" or "json"

Response fields: Array of relationships with sourceDataset, targetDataset, sourceField, targetField, joinType

Example response
{
  "relationships": [
    {
      "sourceDataset": "orders",
      "targetDataset": "customers",
      "sourceField": "customer_id",
      "targetField": "id",
      "joinType": "many_to_one"
    }
  ]
}

Query Tools

semaphor_analyze

Executes governed Semaphor analytics. Use this as the default query tool for semantic metric-by-dimension, top-N, time-series, filters, latest-available windows, period comparisons, period-change driver analysis, and relationship-aware joins. Respects all security policies.

Parameters:

ParameterTypeRequiredDefaultDescription
projectIdstringNoFrom sessionProject ID
domainIdstringRecommended—Semantic domain ID from semaphor_list_semantic_domains
datasetNamestringRecommended—Base dataset name from semaphor_list_datasets
metricsarrayYes—Metric names or source-bearing refs. Each metric may include aggregate as a query-specific override
primaryMetricstring or objectNoFirst metricMetric used for ranking, summaries, and comparisons. Must match one selected metric
dimensionsarrayNo[]Dimension names or source-bearing refs, including fields from reachable joined datasets
dateFieldstring or objectNoInferred when requiredDate field for time windows and comparisons
timeGrainenumNo—day, week, month, quarter, or year
timeWindowobjectNo—Bounded window such as { "unit": "month", "value": 6, "anchor": "latest_available" }
calendarContextobjectNoToken/default calendarTimezone and calendar settings such as { "tz": "America/Chicago" }
comparisonobjectNo—Baseline such as { "kind": "previous_period" }, { "kind": "previous_year" }, or { "kind": "target", "targetValue": 100 }
analysisModeenumNo"standard"Use "period_change" for spike, decline, volatility, or period-over-period change analysis
driverModeenumNo—Driver bucket for previous-period comparisons
includePopulationbooleanNofalseInclude total population metrics for share/concentration analysis
limitintegerNo100Max result rows, up to 1000
activeFiltersarrayNo[]Canonical analytics filters
response_formatenumNo"json""markdown" or "json"

Response fields: data, columns, rowCount, generated sql, executionResult, relationship diagnostics, and time-window/aggregate metadata where applicable.

Comparison behavior follows the shared Metric Comparisons contract. Omit comparison when no comparison is requested.

Example
{
  "name": "semaphor_analyze",
  "arguments": {
    "domainId": "dom_abc",
    "datasetName": "orders",
    "metrics": [{ "datasetName": "orders", "name": "total_amount" }],
    "dimensions": [{ "datasetName": "customers", "name": "region" }],
    "limit": 10
  }
}
Metric aggregate override
{
  "name": "semaphor_analyze",
  "arguments": {
    "domainId": "dom_abc",
    "datasetName": "orders",
    "metrics": [
      { "datasetName": "orders", "name": "gross_margin_value", "aggregate": "AVG" }
    ],
    "primaryMetric": {
      "datasetName": "orders",
      "name": "gross_margin_value",
      "aggregate": "AVG"
    },
    "dimensions": [{ "datasetName": "products", "name": "category" }]
  }
}

semaphor_query_sql_advanced

Executes a SQL-first query for advanced analysis that cannot be expressed through semaphor_analyze. Respects all security policies.

Parameters:

ParameterTypeRequiredDefaultDescription
projectIdstringNoFrom sessionProject ID
connectionIdstringYes—Connection ID
sqlstringYes—SQL query to execute
pythonstringNo—Python code for post-processing
response_formatenumNo"json""markdown" or "json"

Response fields: data (array of records), columns, rowCount, queryTime

Example
{
  "name": "semaphor_query_sql_advanced",
  "arguments": {
    "connectionId": "conn_123",
    "sql": "SELECT region, COUNT(*) AS orders, SUM(total_amount) AS revenue FROM orders GROUP BY region ORDER BY revenue DESC"
  }
}

Common Parameters

These parameters are shared across most tools:

ParameterTypeDefaultDescription
response_format"markdown" | "json"Varies by toolOutput format
projectIdstringFrom session or tokenProject scope (optional on most tools)

On this page