Skip to main content
Glama
Teradata

Teradata MCP Server

Official
by Teradata

rag_Execute_Workflow

Execute a full RAG pipeline to answer user questions by retrieving relevant document chunks and quoting them directly.

Instructions

Execute complete RAG workflow to answer user questions based on document context. This tool handles the entire RAG pipeline in a single step when a user query is tagged with /rag.

WORKFLOW STEPS (executed automatically):

  1. Configuration setup using configurable values from rag_config.yml

  2. Store user query with '/rag ' prefix stripping

  3. Generate query embeddings using either BYOM (ONNXEmbeddings) or IVSM functions based on config

  4. Perform semantic search against precomputed chunk embeddings

  5. Return context chunks for answer generation

CONFIGURATION VALUES (from rag_config.yml):

  • version: 'ivsm' or 'byom' to select embedding approach

  • All database names, table names, and model settings are configurable

  • Vector store metadata fields are dynamically detected

  • Embedding parameters are configurable

  • Default chunk retrieval count is configurable

  • Default values are provided as fallback

TECHNICAL DETAILS:

  • Strips the '/rag ' prefix if present from user questions

  • Creates query table if it does not exist (columns: id, txt, created_ts)

  • BYOM approach: Uses mldb.ONNXEmbeddings UDF for tokenization and embedding

  • IVSM approach: Uses ivsm.tokenizer_encode and ivsm.IVSM_score functions

  • Both approaches store embeddings in configured output table

  • Uses cosine similarity via TD_VECTORDISTANCE for semantic search

  • Returns the top-k matching chunks from the configured vector store

  • Each result includes chunk text, similarity score, and metadata fields

CRITICAL ANSWERING RULES:

  • Answer ONLY using retrieved chunks - no external knowledge, speculation, or inference

  • Quote source content directly without paraphrasing, summarizing, or rewriting

  • If no relevant context found: "Not enough information found in the provided context"

  • If partial context: "The available context does not fully answer the question"

  • Include document/page references when available (e.g., "On page 2 of 'demo_policy.pdf'...")

  • Execute entire workflow silently without showing function calls to user - only show final answer

LANGUAGE RESTRICTIONS:

  • Do not say "According to the context" or "The context says" - just quote directly

  • Do not say "It can be inferred that..." - no inference allowed

  • Use exact or near-verbatim quotes only

  • No paraphrasing, summarizing, or adding transitions between quotes

  • Copy content precisely - no expansion or interpretation

BEHAVIORAL REQUIREMENTS:

  • Execute all RAG workflow steps silently without showing tool calls to users

  • Only display final answers based strictly on retrieved context chunks

  • Do not use external knowledge or speculation - only quote retrieved content directly

  • RAG mode only triggers with explicit /rag prefix - do not enter RAG mode implicitly

  • Hide all tool execution steps from user

  • Provide clean, direct response with only the answer based on retrieved chunks

  • This is a complete end-to-end RAG workflow - no additional tools needed

EXECUTION: Run completely silently - user only sees their question and the final context-grounded answer.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
questionYes
kNo
Behavior5/5

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

No annotations are provided, so the description carries full burden. It details workflow steps, technical implementation (BYOM vs IVSM), answering rules, language restrictions, and silent execution. It fully discloses behavioral traits such as stripping the '/rag' prefix, creating tables, and using cosine similarity.

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

Conciseness3/5

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

The description is lengthy (multiple paragraphs with sections) and contains some redundancy (e.g., answering rules restated). It is well-structured but could be more concise. For a complex tool, length is justified, but there is room for trimming.

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

Completeness4/5

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

Given the complexity of a multi-step RAG pipeline and missing output schema/annotations, the description is quite complete. It covers workflow, configuration, technical details, and rules. It does not cover error handling or edge cases explicitly, but the answering rules provide guidance on insufficient context.

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?

The input schema has two parameters (question, k) with 0% description coverage. The description adds meaning by explaining that the question has '/rag ' prefix stripped, and that 'k' controls the number of retrieved chunks (top-k). While not explicit about default or allowed range, it provides useful context beyond the schema.

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 that the tool executes a complete RAG workflow to answer user questions based on document context. It specifies the trigger prefix '/rag' and distinguishes itself from sibling tools, which are unrelated to RAG functionality. The verb 'execute' and resource 'RAG workflow' are specific.

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?

The description explicitly says to use this tool when a user query is tagged with '/rag'. It implies it is not for general queries, but does not provide explicit when-not-to-use or alternatives. However, the context is clear enough for an agent to decide.

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/Teradata/teradata-mcp-server'

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