Skip to main content
Glama

ai_chat

Submit questions to Secoda AI and get answers. Continue conversations by passing the chat ID from a previous session.

Instructions

Start an AI chat session in Secoda and wait for the response.

Submits a prompt to the Secoda embedded AI endpoint and polls until the
response is complete. Sends MCP progress notifications at each poll interval
so clients can show elapsed time. Returns the AI's response text along with
the chat ID, which can be passed as `parent` in a follow-up call to continue
the conversation.

Args:
    prompt: The message or question to send to the Secoda AI.
    ctx: MCP context (injected by FastMCP; not part of the tool schema).
    parent: Chat ID of a previous conversation to continue (optional).
        Pass the chat_id from a previous ai_chat response to maintain context.
    persona_id: Persona ID to use for the AI chat (optional).
        Defaults to AI_PERSONA_ID env var if set, otherwise the workspace default persona.
    poll_interval_seconds: Seconds between polling attempts (default: 10).
    timeout_seconds: Maximum seconds to wait for completion (default: 360).

Returns:
    JSON with keys:
        - success: true
        - chat_id: The ID of this chat (use as `parent` in follow-up calls)
        - status: "completed"
        - response_content: The AI's response text

Example:
    # Start a new conversation
    ai_chat(prompt="How do we handle price reductions in GMV calculations?")

    # Continue a previous conversation
    ai_chat(
        prompt="Can you elaborate on the discount logic?",
        parent="0d53d57b-d1ef-4fc2-bc50-fd3fba2fea93"
    )

Error handling:
    - 403: Permission denied - check API token has AI chat permissions
    - 429: Rate limit exceeded - tool retries automatically
    - Timeout: Increase timeout_seconds if the AI takes longer than expected

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYesThe message or question to send to the Secoda AI
parentNoChat ID of a previous conversation to continue. Use the chat_id returned from a previous ai_chat call to maintain conversation context.
persona_idNoPersona ID to use for the AI chat. Defaults to the AI_PERSONA_ID environment variable if set, otherwise the workspace default persona is used.
poll_interval_secondsNoSeconds between polling attempts while waiting for the AI to respond (default: 10)
timeout_secondsNoMaximum seconds to wait for the AI to complete the response (default: 360)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Disclosures beyond annotations: polling with progress notifications, continuation via parent, return structure, error handling (403, 429, timeout), and that ctx is injected by FastMCP. Annotations (openWorldHint=true) are consistent with non-idempotent chat behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured: summary line, then parameters with defaults, return format, example, and error handling. Each section is concise and front-loaded. No redundant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Complete for a tool with 5 parameters, polling, continuation, and error handling. The description covers all aspects: how to start, continue, handle errors, and what to expect as output. Output schema is implied in the returns section.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. Description adds value by explaining the purpose of each parameter (e.g., parent usage, persona defaults, polling/timeout defaults) and provides usage context beyond schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'start', resource 'AI chat session', and action 'wait for response'. It distinguishes this tool from sibling tools which are about data retrieval and entity lineage, not AI chat.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit context for when to use the tool, including examples for starting and continuing conversations. Error handling with specific HTTP codes and automatic retries is included. No explicit 'when not to use' statement, but sibling tools imply alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mbrummerstedt/secoda-analysis-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server