Skip to main content
Glama

graph_graph_topo_sort

Compute topological ordering of a named graph, returning a list of nodes or an error if a cycle is detected.

Instructions

[graph] Return topological order as a list, or error if the graph has a cycle.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes

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 provides basic behavioral information: returns a list or error on cycle. However, it does not disclose whether the graph must exist, whether the tool modifies the graph, or what happens for invalid input. The output schema exists but is not referenced in the description. Overall, transparency is adequate but not rich.

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 a single sentence that efficiently conveys the core functionality. Every word serves a purpose, and the key information (return topological order, error on cycle) is front-loaded. No unnecessary details.

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

Completeness3/5

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

Given the simplicity of the tool and the presence of an output schema, the description covers the essential behavior. However, it lacks context about the graph name parameter (e.g., how to specify the graph) and error handling beyond cycle detection. The tool is a basic query, so completeness is adequate but not thorough.

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

Parameters2/5

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

The parameter 'name' is required and its purpose is only vaguely implied by the '[graph]' prefix. The description does not explain what 'name' refers to (e.g., graph identifier, file path). With 0% schema description coverage, the description fails to compensate by adding meaning to the parameter, leaving the agent to infer from context.

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's purpose: to return the topological order of a graph as a list, or an error if the graph has a cycle. It specifies the verb (return), resource (topological order), and distinguishes from sibling tools like graph_graph_has_cycle (which only checks for cycles) and graph_graph_ancestors (which returns ancestors, not a total order).

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 obtaining topological ordering but does not explicitly state when to use this tool versus alternatives. For instance, it could mention that graph_graph_has_cycle can be used first to check for cycles, or that this tool is for linear ordering. No explicit guidelines or exclusions are provided.

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/0-co/agent-friend'

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