Skip to main content
Glama

search_ave

Search AVE records by keyword across ID, title, attack class, description, and behavioral fingerprint to retrieve severity, CVSS-AI score, and full record link.

Instructions

Search AVE records by keyword.

Searches across AVE ID, title, attack class, description, and behavioral fingerprint. Returns matching records with severity, CVSS-AI score, and a link to the full record.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch term (e.g. "tool poisoning", "credential", "MCP01")
limitNoMaximum number of results to return (default 10, max 20)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The `search_ave` function is an MCP tool decorated with @mcp.tool(). It accepts a `query` string and optional `limit` (default 10, max 20). It calls the PiranhaDB API at /records/search, formats each result with severity, CVSS-AI score, OWASP MCP categories, and a link to the full record. Returns a human-readable string.
    @mcp.tool()
    def search_ave(
        query: str,
        limit: int = 10,
    ) -> str:
        """
        Search AVE records by keyword.
    
        Searches across AVE ID, title, attack class, description, and
        behavioral fingerprint. Returns matching records with severity,
        CVSS-AI score, and a link to the full record.
    
        Args:
            query: Search term (e.g. "tool poisoning", "credential", "MCP01")
            limit: Maximum number of results to return (default 10, max 20)
        """
        limit = min(limit, 20)
        data = _piranha_get(f"/records/search?q={urllib.parse.quote(query)}&limit={limit}")
    
        if data.get("error"):
            return f"Error: {data['error']}"
    
        records = data.get("records", [])
        total = data.get("total", 0)
    
        if not records:
            return f"No AVE records found for query: {query}"
    
        lines = [f"Found {total} record(s) for '{query}' (showing {len(records)})", ""]
    
        for r in records:
            ave_id = r.get("ave_id", "")
            title = r.get("title", "")
            severity = r.get("severity", "")
            score = r.get("cvss_ai_score", 0)
            owasp_mcp = ", ".join(r.get("owasp_mcp", []))
            lines.append(f"[{severity} {score}] {ave_id}  {title}")
            if owasp_mcp:
                lines.append(f"  OWASP MCP: {owasp_mcp}")
            lines.append(f"  {PIRANHA_API}/records/{ave_id}")
            lines.append("")
    
        return "\n".join(lines)
  • The tool is registered with the FastMCP server via the @mcp.tool() decorator on line 402, which registers it as the 'search_ave' tool.
    @mcp.tool()
  • The `_piranha_get` helper function is used by `search_ave` to make HTTP GET requests to the PiranhaDB API.
    def _piranha_get(path: str) -> dict:
        """GET from PiranhaDB API. Returns parsed JSON or error dict."""
        url = f"{PIRANHA_API}{path}"
        content, err = _fetch_url(url)
        if err:
            return {"error": f"PiranhaDB unavailable: {err}"}
        try:
            return json.loads(content)
        except json.JSONDecodeError:
            return {"error": "Invalid response from PiranhaDB"}
  • The docstring and type annotations define the schema: `query` (str) is required, `limit` (int, default 10) is optional. The return type is str.
    """
    Search AVE records by keyword.
    
    Searches across AVE ID, title, attack class, description, and
    behavioral fingerprint. Returns matching records with severity,
    CVSS-AI score, and a link to the full record.
    
    Args:
        query: Search term (e.g. "tool poisoning", "credential", "MCP01")
        limit: Maximum number of results to return (default 10, max 20)
    """
Behavior4/5

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

With no annotations, the description carries full burden. It discloses that the tool returns matching records with severity, CVSS-AI score, and a link, and is clearly a read-only operation. However, it does not mention rate limits or authentication requirements, which are minor for a search tool.

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 highly concise with two sentences. The first sentence front-loads the main purpose, and every sentence adds value without waste.

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

Completeness4/5

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

Given the tool's complexity, the description adequately covers purpose, return values, and search scope. It is complete enough for a search tool, though it could explicitly mention pagination via the limit parameter.

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 baseline is 3. The description adds no extra meaning beyond the schema; it mentions search fields but not parameter details, which are already well-documented in the schema.

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 searches AVE records by keyword, listing specific fields searched (AVE ID, title, attack class, etc.), and distinguishes from siblings like list_ave and lookup_ave by focusing on keyword search.

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

Usage Guidelines3/5

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

The description implies usage for searching by keyword but does not explicitly compare to siblings or specify when not to use it. It lacks guidance on alternatives like lookup_ave for ID-based lookup.

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/bawbel/bawbel-mcp'

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