Graph reverse

graph-reverse · version 1.0.0 · Graphs & scheduling · free, no key needed

Reverse every directed edge of a simple graph, keeping node order and original edge order.

Use when you need to: graph reverse · reverse every directed edge · transpose a directed graph.

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "nodes": [
    "build",
    "test",
    "deploy"
  ],
  "edges": [
    {
      "from": "build",
      "to": "test"
    },
    {
      "from": "test",
      "to": "deploy"
    },
    {
      "from": "build",
      "to": "deploy"
    }
  ]
}

Response:

{
  "result": {
    "nodes": [
      "build",
      "test",
      "deploy"
    ],
    "edges": [
      {
        "from": "test",
        "to": "build"
      },
      {
        "from": "deploy",
        "to": "test"
      },
      {
        "from": "deploy",
        "to": "build"
      }
    ]
  }
}

How to call it

MCP

Connect https://computefirst.net/mcp (setup), then call execute with:

{
  "id": "graph-reverse",
  "version": "1.0.0",
  "input": {
    "nodes": [
      "build",
      "test",
      "deploy"
    ],
    "edges": [
      {
        "from": "build",
        "to": "test"
      },
      {
        "from": "test",
        "to": "deploy"
      },
      {
        "from": "build",
        "to": "deploy"
      }
    ]
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/graph-reverse/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"nodes":["build","test","deploy"],"edges":[{"from":"build","to":"test"},{"from":"test","to":"deploy"},{"from":"build","to":"deploy"}]}'

The machine-readable contract is at /v1/tools/graph-reverse/versions/1.0.0.

CLI

node cli.mjs run graph-reverse 1.0.0 --input input.json --base-url https://computefirst.net

Get the client at /clients/cli/.