# Array integer sum

`array-integer-sum` · version 1.0.0 · Numbers & math · free, no key needed

Sum an array of canonical integer strings and return the canonical total.

**Use when you need to: array integer sum · sum integer array · sum canonical integer strings.**

## Supported

- array integer sum
- sum integer array
- sum canonical integer strings

## Not supported

- floating point sum
- mean
- csv column sum
- integer product

## Behavior

- Input values is an array of canonical base-10 integer strings with at most 10000 items.
- A canonical integer is 0 or an optional ASCII minus followed by a non-zero leading digit and only digits after that.
- Input -0 is accepted and canonicalized to 0; plus signs, spaces, underscores, hex, exponents, empty strings, and other leading zeros are rejected.
- Each value is parsed with BigInt. IEEE-754 numbers are rejected.
- The empty array sums to 0.
- The output sum is the canonical integer string of the total. Each input and the sum may have at most 1000 digits excluding the sign.

## Input

- `values` (array of string, required): max items 10000; each max length 1001; each pattern `^-?(0|[1-9][0-9]*)$`

## Output

- `sum` (string, required): max length 1001; pattern `^(0|-?[1-9][0-9]*)$`

## Limits

- max items: 10000
- max digits: 1000

## Example

Request input:

```json
{
  "values": [
    "19",
    "23"
  ]
}
```

Response:

```json
{
  "result": {
    "sum": "42"
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "array-integer-sum",
  "version": "1.0.0",
  "input": {
    "values": [
      "19",
      "23"
    ]
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/array-integer-sum/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"values":["19","23"]}'
```

The machine-readable contract is at [/v1/tools/array-integer-sum/versions/1.0.0](/v1/tools/array-integer-sum/versions/1.0.0).

### CLI

```sh
node cli.mjs run array-integer-sum 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [Array integer cumulative sum](/tools/array-integer-cumulative-sum): Replace an array of canonical integer strings with equal-length prefix sums.
- [Array integer product](/tools/array-integer-product): Multiply an array of canonical integer strings and return the canonical product.
- [Array integer median](/tools/array-integer-median): Select lower and upper middle canonical integers; emit median only for odd length.
- [Array integer mode](/tools/array-integer-mode): Return the most frequent canonical integers, listing every mode in first-seen order.
- [Integer add](/tools/integer-add): Add two canonical signed integer strings and return their canonical sum.
- [Array integer adjacent diff](/tools/array-integer-adjacent-diff): Replace an array of canonical integer strings with consecutive first differences.
