# Integer add

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

Add two canonical signed integer strings and return their canonical sum.

**Use when you need to: integer add · add two integers · sum two integer strings.**

## Supported

- integer add
- add two integers
- sum two integer strings

## Not supported

- decimal add
- floating point add
- integer multiply
- scientific notation
- locale digit grouping
- hexadecimal add

## Behavior

- Inputs a and b are signed base-10 integer strings parsed with BigInt.
- 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; +, spaces, underscores, hex, exponents, empty strings, and other leading zeros are rejected.
- The output value is the canonical integer string of a + b.
- Each input and the sum may have at most 1000 digits excluding the sign.

## Input

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

## Output

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

## Limits

- max digits: 1000

## Example

Request input:

```json
{
  "a": "19",
  "b": "23"
}
```

Response:

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

## How to call it

### MCP

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

```json
{
  "id": "integer-add",
  "version": "1.0.0",
  "input": {
    "a": "19",
    "b": "23"
  }
}
```

### HTTP (no key)

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

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

### CLI

```sh
node cli.mjs run integer-add 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 mode](/tools/array-integer-mode): Return the most frequent canonical integers, listing every mode in first-seen order.
- [Array integer sum](/tools/array-integer-sum): Sum an array of canonical integer strings and return the canonical total.
- [Integer compare](/tools/integer-compare): Compare two canonical signed base-10 integer strings using BigInt.
- [Integer GCD](/tools/integer-gcd): Compute the non-negative greatest common divisor of two canonical integer strings.
- [Integer LCM](/tools/integer-lcm): Compute the non-negative least common multiple of two canonical integer strings.
