{"id":"graph-topological-sort","version":"1.0.0","description":"Return a Kahn topological order of a directed acyclic graph, breaking ready-set ties by declared node index.","supported_operations":["graph topological sort","kahn topological order","linearize dag dependencies"],"unsupported_operations":["partial topological order of a subgraph","weighted edges","lexicographic-by-id ready-set ties","undirected topological sort"],"semantics":["Input is a directed simple graph: unique non-empty node id strings and unique {from, to} edges whose endpoints both appear in nodes.","Edge from→to is a prerequisite: from must complete before to, so from appears before to in the order.","The order is Kahn topological sort: repeatedly emit the remaining node of indegree 0 with the smallest declared index in the nodes array.","Ready-set ties use declared node index only; node ids are not ordered lexicographically.","If a cycle exists, including a self-loop, run throws invalid_input with a message containing \"cycle\".","The output order lists every node id exactly once. The empty graph returns { order: [] }."],"limits":{"max_nodes":2000,"max_edges":10000,"max_node_id_bytes":256},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"required":["nodes","edges"],"properties":{"nodes":{"type":"array","maxItems":2000,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":256}},"edges":{"type":"array","maxItems":10000,"items":{"type":"object","additionalProperties":false,"required":["from","to"],"properties":{"from":{"type":"string","minLength":1,"maxLength":256},"to":{"type":"string","minLength":1,"maxLength":256}}}}}},"output_schema":{"type":"object","additionalProperties":false,"required":["order"],"properties":{"order":{"type":"array","items":{"type":"string"}}}},"examples":[{"input":{"nodes":["deploy","build","lint","test"],"edges":[{"from":"build","to":"test"},{"from":"lint","to":"test"},{"from":"test","to":"deploy"}]},"output":{"order":["build","lint","test","deploy"]}}],"execute_url":"/v1/tools/graph-topological-sort/versions/1.0.0/execute"}