Skip to content

Tools Overview

Foggy MCP provides a series of data query and analysis tools for AI assistants to call.

Tool List

ToolDescriptionCategory
dataset.get_metadataGet user-accessible model listMetadata
dataset.describe_model_internalGet model field detailsMetadata
dataset.query_modelExecute structured query, timeWindow, and pivotQuery
dataset_nl.queryNatural language data queryNatural Language
chart.generateGenerate data chartsVisualization
dataset.export_with_chartExport data and chartsExport

Tool Categories

Metadata Tools

Used to get meta-information about semantic layer models and fields:

  • get_metadata - Get overview of all available models
  • describe_model_internal - Get detailed field definitions of a single model

Suitable for understanding data structure before querying.

Query Tools

Used to execute structured data queries:

  • query_model - Supports filtering, sorting, grouping, aggregation, calculated fields, timeWindow, and pivot

Requires understanding of semantic layer models and query syntax, provides precise query control.

Natural Language Tools

Used for intelligent data queries:

  • dataset_nl.query - Describe query requirements in natural language

No technical knowledge needed, suitable for regular business users.

Visualization Tools

Used to generate charts:

  • chart.generate - Generate trend charts, bar charts, pie charts based on data

Export Tools

Used to export data:

  • export_with_chart - Export query results and charts

Role Permissions

Different endpoints provide different tool sets:

Permission Matrix

ToolAdminAnalystBusiness
dataset.get_metadata
dataset.describe_model_internal
dataset.query_model
chart.generate
dataset.export_with_chart
dataset_nl.query

Endpoint Description

EndpointRoleTool Scope
/mcp/admin/rpcAdminAll tools
/mcp/analyst/rpcAnalystMetadata + Query + Visualization
/mcp/business/rpcBusiness UserNatural language only

Typical Workflows

Analyst Workflow

1. get_metadata          → Get available model list
2. describe_model_internal → View model field details
3. query_model           → Execute data query
4. chart.generate        → Generate chart (optional)

Business User Workflow

1. dataset_nl.query      → Describe requirements in natural language, done in one step

Tool Call Examples

MCP Protocol Call

json
{
  "jsonrpc": "2.0",
  "id": "1",
  "method": "tools/call",
  "params": {
    "name": "dataset.get_metadata",
    "arguments": {}
  }
}

Response Format

json
{
  "jsonrpc": "2.0",
  "id": "1",
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{...}"
      }
    ]
  }
}

Error Handling

Tool calls may return the following errors:

Error CodeDescription
-32600Invalid request
-32601Method not found
-32602Invalid params
-32603Internal error

Error Response Example

json
{
  "jsonrpc": "2.0",
  "id": "1",
  "error": {
    "code": -32602,
    "message": "Missing required parameter: model"
  }
}

Performance Tips

  1. Get metadata first: Use get_metadata before querying to understand available models
  2. Use pagination: Use start and limit parameters for large data queries
  3. Add filter conditions: Avoid full table scans, use slice to filter data
  4. Select necessary fields: Only query needed columns to reduce data transfer
  5. Use the right advanced mode: Use timeWindow for YoY/MoM/rolling analysis and pivot for cross-tabs; do not combine them in one request

Next Steps