Skip to main content
Glama
OyaAIProd

Exploit Intel Platform MCP Server

by OyaAIProd

get_cwe

Read-onlyIdempotent

Retrieve full details for a specific CWE, including name, description, exploit likelihood, parent CWE, and vulnerability count. Input a CWE ID (e.g., CWE-79) to get comprehensive information.

Instructions

Get details for a specific CWE including full name, description, exploit likelihood, parent CWE, and total vulnerability count. Example: cwe_id='CWE-79' returns details about Cross-Site Scripting.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwe_idYesCWE identifier (e.g. 'CWE-79' or '79')

Implementation Reference

  • The main handler function for the 'get_cwe' tool. Validates the CWE ID, calls the API client, and formats the detail response.
    def _tool_get_cwe(args: dict[str, Any]) -> str:
        cwe_id = validators.validate_cwe(args.get("cwe_id", ""))
        data = api_client.get_cwe(f"CWE-{cwe_id}")
        return formatters.format_cwe_detail(data)
  • Registration of 'get_cwe' in the dispatch table, mapping the tool name to its handler function _tool_get_cwe.
    _TOOLS_WITH_ARGS: dict[str, Callable[[dict[str, Any]], str]] = {
        "search_vulnerabilities": _tool_search,
        "get_vulnerability": _tool_get_vuln,
        "get_exploit_code": _tool_get_code,
        "get_exploit_analysis": _tool_get_exploit_analysis,
        "get_nuclei_templates": _tool_get_nuclei,
        "search_exploits": _tool_search_exploits,
        "list_authors": _tool_list_authors,
        "get_author": _tool_get_author,
        "get_cwe": _tool_get_cwe,
        "list_products": _tool_list_products,
        "lookup_alt_id": _tool_lookup_alt_id,
        "audit_stack": _tool_audit_stack,
        "generate_finding": _tool_generate_finding,
    }
  • Helper formatter that converts the CWE detail API response into user-friendly text output.
    def format_cwe_detail(data: dict[str, Any]) -> str:
        """Format CWE detail."""
        lines = [
            _UNTRUSTED_NOTICE,
            "",
            f"{_sanitize_untrusted_text(data['cwe_id'], max_len=40)}: {_sanitize_untrusted_text(data['name'], max_len=200)}",
        ]
        if data.get("short_label"):
            lines.append(f"Short label: {_safe_inline(data['short_label'], max_len=160)}")
        if data.get("likelihood"):
            lines.append(f"Exploit likelihood: {_safe_inline(data['likelihood'], max_len=80)}")
        lines.append(f"Vulnerabilities: {data.get('vuln_count', 0):,}")
    
        parent = data.get("parent_cwe")
        if parent:
            parent_id = _sanitize_untrusted_text(parent.get("cwe_id"), max_len=40)
            parent_name = _sanitize_untrusted_text(parent.get("name"), max_len=120)
            lines.append(f"Parent: {parent_id} ({parent_name})")
    
        if data.get("description"):
            lines.append(f"\nDescription:\n{_safe_inline(_truncate(data['description'], 550), max_len=650)}")
    
        return "\n".join(lines)
  • API client method that sends an HTTP GET request to the EIP API to fetch CWE details.
    def get_cwe(cwe_id: str) -> dict[str, Any]:
        """Get CWE detail."""
        cwe_seg = _safe_path_segment(cwe_id)
        return _request_json(f"/api/v1/cwe/{cwe_seg}")
  • Schema definition for the 'get_cwe' tool including name, description, and input schema (cwe_id with regex pattern validation).
    types.Tool(
        name="get_cwe",
        annotations=_ro_annotations("Get CWE Detail"),
        description=(
            "Get details for a specific CWE including full name, description, exploit "
            "likelihood, parent CWE, and total vulnerability count. "
            "Example: cwe_id='CWE-79' returns details about Cross-Site Scripting."
        ),
        inputSchema={
            "type": "object",
            "properties": {
                "cwe_id": {
                    "type": "string",
                    "pattern": _CWE_PATTERN,
                    "maxLength": 12,
                    "description": "CWE identifier (e.g. 'CWE-79' or '79')",
                },
            },
            "required": ["cwe_id"],
        },
    ),
Behavior3/5

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

Annotations already set readOnlyHint, destructiveHint, idempotentHint, openWorldHint, covering safety and idempotency. The description adds which data fields are returned but not additional behavioral context like rate limits or authentication requirements.

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?

Two sentences: purpose and example. No filler. Could be slightly more structured (e.g., list fields in a bullet), but very efficient.

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?

For a simple read tool with full annotations and no output schema, the description adequately covers what the tool does and what it returns. The list of returned fields is helpful. Minor omission: no mention of response format or potential missing fields if CWE not found.

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?

The input schema has 100% coverage with a clear description for 'cwe_id'. The tool description does not add new information beyond the schema; the example echoes the schema's pattern. 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 action (Get details) and the resource (specific CWE), listing the exact fields returned (full name, description, exploit likelihood, parent CWE, total vulnerability count). The example reinforces understanding. This distinguishes it from sibling 'list_cwes' which returns a list.

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 fetching a single CWE's details but does not explicitly state when to prefer this over alternatives like 'list_cwes' or 'search_vulnerabilities'. No 'when not to use' or alternative tool mentions.

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/OyaAIProd/eip-mcp'

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