Skip to main content
Glama
enkryptai

Enkrypt AI MCP Server

Official
by enkryptai

use_policy_to_detect

Apply a specified policy to identify and analyze violations within text inputs, supporting real-time safety and compliance monitoring in AI applications.

Instructions

Use a policy to detect violations in the provided text.

Args: policy_name: The name of the policy to use for detection. text: The text to check for policy violations.

Returns: A dictionary containing the response message and details of the detection.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
policy_nameYes
textYes

Implementation Reference

  • The handler function for the 'use_policy_to_detect' tool. It is registered via the @mcp.tool() decorator. The function takes a policy_name and text, calls guardrails_client.policy_detect, and returns the result as a dictionary.
    @mcp.tool()
    def use_policy_to_detect(policy_name: str, text: str) -> Dict[str, Any]:
        """
        Use a policy to detect violations in the provided text.
    
        Args:
            policy_name: The name of the policy to use for detection.
            text: The text to check for policy violations.
    
        Returns:
            A dictionary containing the response message and details of the detection.
        """
        # Use policy to detect
        policy_detect_response = guardrails_client.policy_detect(
            policy_name=policy_name,
            text=text
        )
    
        # Return the response as a dictionary
        return policy_detect_response.to_dict()
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 detection but doesn't disclose behavioral traits like what constitutes a 'violation', whether this is a read-only analysis or has side effects, authentication requirements, rate limits, or error conditions. The description is too vague about the actual behavior beyond the basic operation.

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

Conciseness4/5

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

The description is appropriately concise with a clear purpose statement followed by structured sections for Args and Returns. Every sentence serves a purpose, though the return description could be more specific. The structure helps readability but isn't perfectly front-loaded with all critical information.

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

Completeness2/5

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

Given no annotations, 0% schema coverage, no output schema, and 2 parameters, the description is incomplete. It lacks details on policy behavior, detection criteria, output format specifics, error handling, and differentiation from sibling tools. For a detection tool with policy dependencies, this leaves too many contextual gaps for reliable agent use.

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 schema provides no parameter documentation. The description adds basic semantics for both parameters ('policy_name' and 'text'), explaining what they represent. However, it doesn't provide details like policy format, text length limits, or examples, leaving significant gaps in understanding how to use them effectively.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/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: 'Use a policy to detect violations in the provided text.' This specifies the verb ('detect'), resource ('violations'), and target ('text'). However, it doesn't explicitly differentiate from sibling tools like 'guardrails_detect' or 'retrieve_policy_configuration', which appear related to similar policy/detection functionality.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With sibling tools like 'guardrails_detect' and 'retrieve_policy_configuration' present, there's no indication of the specific use case, prerequisites, or how this tool differs from others in the policy/detection domain.

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

Related 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/enkryptai/enkryptai-mcp-server'

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