Skip to main content
Glama

groundlens_sgi

Read-onlyIdempotent

Evaluate if an LLM response is grounded in source context by computing the ratio of distances to question and context. Use for RAG pipeline verification.

Instructions

Check whether an LLM response is grounded in a source document (SGI).

SGI (Semantic Grounding Index) measures whether the response engaged with the provided context or stayed anchored to the question. This is the method to use for RAG pipeline verification — did the model actually use the retrieved documents?

The score is a ratio: dist(response, question) / dist(response, context). A high ratio means the response moved toward the context (grounded). A low ratio means it stayed near the question (possibly ignored the context).

Args: params (SGIInput): The question, source context, and LLM response.

Returns: str: JSON with a plain-language CHECK, the SGI score, and the two distances.

Examples: - Verifying a RAG chatbot used the retrieved documents - Checking if a summary is faithful to the source text - Auditing whether context was ignored in a customer support bot

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

Annotations already indicate readOnlyHint=true, idempotentHint=true, destructiveHint=false, and the description adds behavioral details: explains the SGI ratio formula, what high/low scores mean, and the return format (JSON with CHECK, score, distances). This goes well beyond annotations, providing full transparency.

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?

The description is well-structured: first sentence states purpose, then explains the metric, then Args/Returns/Examples. It is concise with no wasted words, fully front-loaded, and every sentence adds value.

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 tool's complexity (metric calculation), annotations, and schema, the description is complete. It covers when to use, how the score works, what parameters are needed, what the output looks like, and provides examples. The output schema is mentioned in context signals and the description describes the return format sufficiently.

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% according to context signals, but the nested SGIInput type has descriptions for each field (question, context, response). The tool description repeats the Args without adding new semantic meaning beyond the schema. However, it does explain the functional role of the parameters in the context of the metric, which adds some value. Baseline 3 due to good 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 it checks LLM response grounding in a source document using SGI, and distinguishes itself as the method for RAG pipeline verification. The specific verb 'Check' and resource 'grounding' are well-defined, and the context signals show sibling tools, implying differentiation.

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 'use for RAG pipeline verification' and provides examples of when to use it (verifying RAG chatbot, checking summary faithfulness, auditing context ignoring). It does not explicitly state when not to use or alternatives, but the examples and positioning give clear usage context.

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/groundlens-dev/groundlens-mcp'

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