Skip to main content
Glama

get_cwe_ancestors

Trace the ancestor weaknesses of a given CWE ID. Filter by view or primary parent to map CWE taxonomy relationships precisely.

Instructions

Get ancestors of a specified CWE weakness, filtered by view and primary flag

Args: cwe_id: CWE ID (with/without 'CWE-') view: Optional view identifier to filter relationships primary: Limit ancestors to include only primary parents

Returns: Dictionary with "Ancestors" array or error information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
viewNo
cwe_idYes
primaryNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations, the description must carry the behavioral transparency burden. It discloses the return format (dictionary with 'Ancestors' array or error info) and parameter effects, but does not explicitly state that this is a read-only operation or describe any potential side effects, error conditions, or access requirements.

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 concise, with a clear one-line summary followed by Args and Returns sections. Every sentence adds value without redundancy or unnecessary detail.

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 moderate complexity (3 params, 1 required) and the presence of an output schema, the description covers the essential behavior and parameters. It could be more complete by mentioning usage relative to sibling tools, but it is sufficient for an agent to invoke the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description fully compensates by explaining each parameter: cwe_id format, view as an optional filter, and primary as a way to limit to primary parents. This adds significant meaning beyond the bare 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 the tool gets ancestors of a CWE weakness, using a specific verb and resource. It distinguishes from siblings like get_cwe_children and get_cwe_parents by using 'ancestors' to indicate upward traversal.

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 provides clear context on the purpose and optional filters (view, primary), but does not explicitly mention alternatives or when not to use this tool. The sibling list implies alternatives, but no exclusions are stated.

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/Bilel-Eljaamii/cwe-search_mcp'

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