Skip to main content
Glama
Teradata

Teradata MCP Server

Official
by Teradata

rag_Execute_Workflow

Execute a complete RAG workflow in a single step to answer user questions: generate embeddings, perform semantic search, and answer using only retrieved context.

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?

With no annotations provided, the description fully discloses all behavioral traits: it strips the '/rag' prefix, executes workflow steps silently, creates a query table if not exists, uses cosine similarity, and enforces strict answering rules. No contradictions.

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 very long (approximately 30 lines) and includes repeated answering rules and restrictions. While all content is relevant, it could be more concise without losing clarity.

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?

Given the complexity of the RAG workflow and the absence of an output schema or annotations, the description covers every aspect: purpose, trigger, workflow steps, configuration, technical details, answering rules, language restrictions, and behavioral expectations. It is fully self-contained.

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

Parameters3/5

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

Schema description coverage is 0%, so the description must compensate. It implies that 'question' is the user query and 'k' relates to the number of chunks retrieved, but does not explicitly describe the parameters or their formats. Partial compensation, but not complete.

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 tool's purpose: 'Execute complete RAG workflow to answer user questions based on document context.' This specific verb-resource pairing distinguishes it from sibling tools, which focus on database, graph, plot, or security operations.

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 states that the tool is triggered only when a user query is tagged with '/rag' and that it runs the entire RAG pipeline in a single step. It does not mention when not to use it, but the sibling context makes alternatives obvious.

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