Skip to main content
Glama

gsep_before_llm

Sanitizes and enhances user messages before LLM calls, preventing prompt injection and returning security status for agent protection.

Instructions

Middleware hook to run before any agent calls an LLM. Returns enhanced_prompt, sanitized_message, and C3/security status. Use this when GSEP-MCP protects an existing external agent rather than owning the LLM call.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageYesUser message or external content before it reaches the LLM
user_idNoUser identifier for personalization and audit context
genome_idYesUnique identifier for this agent genome
task_typeNoTask type hint, e.g. support, coding, research
batch_sizeNoOptional batch size hint for batch workflows
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions what the tool returns but fails to disclose behavioral traits such as side effects, error conditions, permissions required, or what happens on failure. The description is insufficient for an agent to fully understand the tool's 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?

Two sentences with no wasted words. The first sentence states purpose and outputs, the second gives usage guidance. Perfectly structured for a tool description.

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

Completeness3/5

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

Given the tool has 5 parameters, no output schema, and no annotations, the description is adequate but not comprehensive. It explains the tool's role as a hook and its return value, but lacks details on error handling, C3/security status meaning, or parameter interdependencies. The schema covers the parameters, so it's minimally complete.

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 100%, so the schema already documents all 5 parameters. The description adds value by listing the return values (enhanced_prompt, sanitized_message, C3/security status), but provides no additional parameter-level semantics beyond the schema. Baseline 3 is appropriate.

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 is a middleware hook executed before LLM calls, specifying it returns enhanced_prompt, sanitized_message, and C3/security status. It distinguishes from siblings by explicitly contrasting when to use this tool versus owning the LLM call.

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 provides explicit usage context: 'Use this when GSEP-MCP protects an existing external agent rather than owning the LLM call.' This implies an alternative (owning the LLM call via gsep_chat) but does not name it explicitly or exclude other scenarios.

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/gsepcore/gsep-mcp'

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