Skip to main content
Glama

cos_graph_centrality

Read-onlyIdempotent

Reveal hub nodes in a code graph to identify chokepoints, refactor priorities, or areas needing extra review. Rank nodes by degree or betweenness to focus attention where it matters.

Instructions

Hub detection — surface high-degree (or high-betweenness) nodes.

Use to identify chokepoints / refactor priorities / nodes that demand extra review.

Args: metric: "degree" (cheap, default) or "betweenness" (expensive). top: Max nodes returned (default 20). kind: Optional kind filter (e.g. "function", "class"). Empty = all.

Returns: JSON envelope with nodes ranked by centrality score.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topNo
kindNo
metricNodegree

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Annotations already establish readOnlyHint, idempotentHint, and destructiveHint, so the safety profile is covered. The description adds valuable behavioral context by noting that betweenness is expensive and that degree is the cheap default, plus describing the return envelope. There are no contradictions with annotations.

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 compact and front-loaded, with a clear one-line summary followed by a terse usage context and parameter list. Every sentence adds value, and no redundant information is included.

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

Completeness5/5

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

With an output schema present and all parameters explained, the description covers the essential semantics needed to invoke the tool correctly. It even notes the difference in computational cost between metrics, which is useful for selecting between degree and betweenness. No critical gaps remain.

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?

Despite a 0% schema description coverage, the description fully explains all three parameters: metric (with values and default), top (max nodes and default), and kind (with example and empty behavior). This compensates entirely for the missing schema annotations.

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 opens with 'Hub detection — surface high-degree (or high-betweenness) nodes', using a specific verb and resource. It clearly distinguishes this tool from sibling graph tools by focusing on centrality metrics, and it ties to concrete use cases (chokepoints, refactor priorities).

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 for when to use the tool ('Use to identify chokepoints / refactor priorities / nodes that demand extra review') and explains the trade-off between metric choices (cheap degree vs expensive betweenness). However, it does not explicitly mention when not to use it or name alternative sibling tools, so it stops short of full exclusion guidance.

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/kouroshez/coding-os'

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