Skip to main content
Glama

topological_sort

Sort record IDs or entity types by dependency order, placing parents before children for reliable data migration.

Instructions

Sort a list of entity types / record IDs in dependency order (parents before children). Useful for relationship-aware migration — e.g. migrate Epics before Stories before Sub-tasks. Provide nodes (IDs) and edges ([parentId, childId] pairs). Returns the sorted order.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodesYesList of record or type identifiers
edgesYesDependency edges: [parent, child]
Behavior4/5

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

No annotations are provided, so the description must disclose behavioral traits. It states the tool sorts and returns the sorted order, implying a read-only operation. It does not mention destructive behavior, permissions, or error handling, but for a sorting tool, the key behavior is adequately described.

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?

Three sentences with no redundancy. The first sentence states the core function, the second provides a usage example, and the third specifies inputs and outputs. Information is front-loaded and every sentence is meaningful.

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 tool with no output schema, the description mentions the return value (sorted order) and inputs. It is mostly complete, though it could mention handling of cycles or invalid edges. However, given the tool's simplicity, the description is sufficient.

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

Parameters4/5

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

Schema coverage is 100% with both parameters described. The description adds value by explaining the edges format as [parentId, childId] pairs and reinforcing the purpose of nodes as identifiers. This goes beyond the schema's terse descriptions.

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 sorts a list of entity types or record IDs in dependency order (parents before children). It specifies the output as sorted order and gives a concrete use case (relationship-aware migration). This distinguishes it from siblings like analyze_dependencies which likely analyze rather than sort.

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 a clear context for when to use the tool (relationship-aware migration) with an example. However, it does not explicitly state when not to use it or mention any alternatives among siblings, but the unique purpose makes it implicit.

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/pinnintisagarSB/ServiceNow-Dev-MCP'

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