Skip to main content
Glama

gsep_after_tool

Scans tool outputs for prompt injection and dangerous instructions before they reach the AI agent.

Instructions

Middleware hook to run after a tool returns external content and before that content is fed back into an agent/LLM. Scans for prompt injection and dangerous action instructions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_idNoUser identifier for personalization and audit context
genome_idYesUnique identifier for this agent genome
task_typeNoTask type hint, e.g. support, coding, research
tool_nameYesName of the tool that produced this result
tool_resultYesRaw tool output before it is sent back into the agent/LLM context
user_messageNoOriginal user request, if available
Behavior3/5

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

Without annotations, the description must disclose behavior. It states that it scans for prompt injection and dangerous actions but does not explain what happens upon detection (e.g., blocks, sanitizes, passes through). This partial disclosure is adequate but not comprehensive.

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 extremely concise at two sentences, front-loading the core purpose and scanning action without any extraneous information. Every word adds value.

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?

The description covers the tool's purpose but lacks details on what it outputs or what happens when threats are detected. Given 6 parameters, no output schema, and no annotations, the description should provide more behavioral context to be fully 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?

All parameters are described in the input schema with clear descriptions. The tool's description does not add new meaning beyond the schema, which is acceptable given 100% schema coverage. Baseline score of 3 applies.

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 specifies the tool as a middleware hook executed after a tool returns external content and before it reaches an LLM, scanning for prompt injection and dangerous actions. This distinguishes it from siblings like gsep_before_tool (before tool) and gsep_after_llm (after LLM).

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 implies where in the pipeline the tool belongs (after tool, before LLM) and contrasts with similarly named siblings (e.g., before_tool). However, it does not explicitly state when to use this tool or when not to, relying on the naming convention for differentiation.

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