Rank borda aggregate

rank-borda-aggregate · version 1.0.0 · Optimization & voting · free, no key needed

Aggregate weighted complete or partial rankings into exact Borda scores, rank groups, and audit contributions.

Use when you need to: aggregate weighted Borda rankings · calculate Borda count scores · combine partial preference rankings.

Decide before calling

Read the versioned contract and the supported scope below. Reuse rank-borda-aggregate@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.

Explain the choice

"I can use rank-borda-aggregate@1.0.0 for aggregate weighted Borda rankings. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "candidates": [
    "alice",
    "bob",
    "carol"
  ],
  "rankings": [
    {
      "ranking": [
        "alice",
        "bob",
        "carol"
      ],
      "weight": 2
    },
    {
      "ranking": [
        "carol",
        "bob",
        "alice"
      ],
      "weight": 1
    }
  ],
  "unranked_policy": "zero"
}

Response:

{
  "result": {
    "scores": [
      {
        "candidate": "alice",
        "score": 4
      },
      {
        "candidate": "bob",
        "score": 3
      },
      {
        "candidate": "carol",
        "score": 2
      }
    ],
    "rank_groups": [
      {
        "rank": 1,
        "score": 4,
        "candidates": [
          "alice"
        ]
      },
      {
        "rank": 2,
        "score": 3,
        "candidates": [
          "bob"
        ]
      },
      {
        "rank": 3,
        "score": 2,
        "candidates": [
          "carol"
        ]
      }
    ],
    "contributions": [
      {
        "ranking_index": 0,
        "weight": 2,
        "points": [
          {
            "candidate": "alice",
            "points": 2,
            "weighted_points": 4
          },
          {
            "candidate": "bob",
            "points": 1,
            "weighted_points": 2
          },
          {
            "candidate": "carol",
            "points": 0,
            "weighted_points": 0
          }
        ]
      },
      {
        "ranking_index": 1,
        "weight": 1,
        "points": [
          {
            "candidate": "alice",
            "points": 0,
            "weighted_points": 0
          },
          {
            "candidate": "bob",
            "points": 1,
            "weighted_points": 1
          },
          {
            "candidate": "carol",
            "points": 2,
            "weighted_points": 2
          }
        ]
      }
    ]
  }
}

How to call it

MCP

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

{
  "id": "rank-borda-aggregate",
  "version": "1.0.0",
  "input": {
    "candidates": [
      "alice",
      "bob",
      "carol"
    ],
    "rankings": [
      {
        "ranking": [
          "alice",
          "bob",
          "carol"
        ],
        "weight": 2
      },
      {
        "ranking": [
          "carol",
          "bob",
          "alice"
        ],
        "weight": 1
      }
    ],
    "unranked_policy": "zero"
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/rank-borda-aggregate/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"candidates":["alice","bob","carol"],"rankings":[{"ranking":["alice","bob","carol"],"weight":2},{"ranking":["carol","bob","alice"],"weight":1}],"unranked_policy":"zero"}'

The machine-readable contract is at /v1/tools/rank-borda-aggregate/versions/1.0.0.

CLI

node cli.mjs run rank-borda-aggregate 1.0.0 --input input.json --base-url https://computefirst.net

Get the client at /clients/cli/.