CWE

get_cwe

Retrieves a single CWE record: name, abstraction level, structure, status, description, extended description, likelihood of exploit, related weaknesses, applicable platforms, modes of introduction, common consequences, detection methods, potential mitigations, observed examples, and related attack patterns. Costs 1 credit.

POST
tools/call

Cost: 1 credit per successful call  ·  Response shape: jsonb

Parameters

cwe_idintegerrequired

CWE numeric identifier, 1–1500. Pass the number only: 89, not CWE-89.

Example invocation

Ask your agent: "Show me the details for CWE-89 (SQL injection)."

curl -s https://mcp.precursorintelligence.com \
  -H "Authorization: Bearer $PRECURSOR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_cwe","arguments":{"cwe_id":89}}}'

Response

result.content[0].text (parsed)
{
  "cwe_id": 89,
  "name": "Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')",
  "abstraction": "Base",
  "structure": "Simple",
  "status": "Stable",
  "description": "The product constructs all or part of an SQL command using externally influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command.",
  "extended_description": "Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.",
  "likelihood_of_exploit": "High",
  "related_weaknesses": ["CWE-74", "CWE-707"],
  "applicable_platforms": [
    { "language": "Any" }
  ],
  "modes_of_introduction": [
    { "phase": "Implementation", "note": "REALIZATION: This weakness is caused during implementation of an architectural security tactic." }
  ],
  "common_consequences": [
    { "scope": ["Confidentiality"], "impact": ["Read Application Data"] },
    { "scope": ["Integrity"], "impact": ["Modify Application Data"] },
    { "scope": ["Access Control"], "impact": ["Bypass Protection Mechanism"] }
  ],
  "detection_methods": [
    { "method": "Automated Static Analysis", "description": "This weakness can often be detected using automated static analysis tools." }
  ],
  "potential_mitigations": [
    { "phase": ["Architecture and Design"], "description": "Use a vetted library or framework that does not allow this weakness to occur, such as parameterized queries or prepared statements." },
    { "phase": ["Implementation"], "description": "Apply input validation to reject unexpected characters." },
    { "phase": ["Architecture and Design", "Operation"], "description": "Run the database account with the minimum privileges required." }
  ],
  "observed_examples": [
    { "reference": "CVE-2024-3094", "description": "SQL injection via unsanitized search parameter.", "link": "https://www.cve.org/CVERecord?id=CVE-2024-3094" }
  ],
  "related_attack_patterns": ["CAPEC-66", "CAPEC-470"],
  "generated_at": "2026-05-29T10:15:00.000Z"
}

The full MCP envelope (including _meta.precursor with request_id, credits, and generated_at) is documented in Response Format.

Errors

CodeMessageWhen
-32602invalid_params: cwe_id: required_integercwe_id was omitted or is not an integer
-32602invalid_params: cwe_id: min:1cwe_id is less than 1
-32602invalid_params: cwe_id: max:1500cwe_id is greater than 1500
-32001unauthorizedInvalid or revoked API key
-32002insufficient_creditsCredit balance is zero

If the requested CWE identifier is within range but not present in the catalog, the tool returns a successful response with { "error": "not_found", "cwe_id": <requested_id> } and the credit is refunded automatically.