Compare Money with Tolerance
money.compare_with_tolerance
Overview
Compare two decimals under an explicit absolute, relative, or basis-point tolerance. The skill uses exact decimal arithmetic, reports the resolved policy, rejects unknown properties, and never fetches a rate or infers accounting policy.
Money arithmetic needs explicit currency, scale, tolerance, and rounding semantics; an LLM cannot guarantee those constraints or reproduce residuals.
Reliability
STRICT and stateless. AMOUNT_INVALID means a malformed or over-limit decimal; fix it. CURRENCY_UNKNOWN means the code is outside the documented allowlist; send a supported code. CURRENCY_MISMATCH is triggered when one sum contains different currency codes; retry only after converting first or splitting the rows by currency. TOLERANCE_INVALID means a negative or unsupported tolerance; correct its type and value. ROUNDING_INVALID means mode or scale is unsupported; choose a documented value. ITEM_LIMIT_EXCEEDED means more than 10,000 rows; split them.
Context footprint
One call returns normalized money strings and the resolved policy. A successful call costs 1 execution credit.
When to use it
When you judge two amounts on the same unit basis inside an explicit absolute, relative, or basis-point band.
When the amounts are in different currencies, or the tolerance type has not been chosen.
Scope
Non-goals
- Does not fetch FX rates or convert currencies
- Does not infer materiality, accounting policy, cash rounding, or locale
- Does not accept unbounded lists or binary floating-point semantics
Properties
Capabilities
Cost & billing
Flat rate per invocation
File handling
How we handle your data
What this means
This skill may receive sensitive content, but it does not target sensitive data and returns only a structured non-sensitive result.
Squillify guarantees
- Runs inside Squillify
- This skill runs inside Squillify.
- Payloads are not sent to an external service by this skill.
- Squillify does not permanently store submitted payloads.
- Telemetry records metadata only, not submitted content.
- Submitted payloads are not used for training.
- Submitted payloads are not reviewed by humans.
- This skill does not target sensitive data.
- The response does not contain submitted content.
Your responsibility
Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.
Input schema
| Field | Type | Required | Description |
|---|---|---|---|
| left | string | Yes | Required plain decimal on the same unit basis as right. |
| right | string | Yes | Required plain decimal on the same unit basis as left. |
| toleranceType | string | Yes | Required absolute, relative, or basis_points. |
| tolerance | string | Yes | Required non-negative plain decimal; relative is a ratio and basis_points is divided by 10,000. |
| referenceSide | string | No | Optional left, right, or max absolute value; omitted means max. Ignored for absolute tolerance. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| withinTolerance | boolean | Yes | Whether absolute difference is at most the resolved limit. |
| difference | string | Yes | Absolute left-right difference. |
| limit | string | Yes | Resolved absolute comparison limit. |
| toleranceType | string | Yes | Applied tolerance type. |
| referenceSide | string | Yes | Resolved reference side. |
API contract
POST /v1/executecurl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"money.compare_with_tolerance","input":{"left":"100.00","right":"100.01","toleranceType":"absolute","tolerance":"0.02"}}'import { Squillify } from "@squillify/sdk";
const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });
const { output } = await sq.execute("money.compare_with_tolerance", {"right":"100.01","tolerance":"0.02","left":"100.00","toleranceType":"absolute"});Errors
| Code | HTTP | Retryable | Description |
|---|---|---|---|
| VALIDATION_ERROR | 400 | No | The request payload failed schema validation. |
| UNAUTHORIZED | 401 | No | Missing or invalid API key. |
| SKILL_NOT_ACCESSIBLE | 403 | No | The API key is not granted access to this skill. |
| SKILL_NOT_AVAILABLE_FOR_PLAN | 403 | No | This skill is not included in your current plan. |
| PLAN_ELIGIBILITY_UNAVAILABLE | 503 | Yes | Plan eligibility could not be decided. Retry after backoff. |
| SKILL_NOT_FOUND | 404 | No | The requested skill or version does not exist. |
| TENANT_RATE_LIMITED | 429 | Yes | Request rate limit exceeded. Retry after backoff. |
| QUOTA_EXCEEDED | 429 | Yes | Plan quota exhausted. Retryable once the quota period resets. |
| EXECUTION_TIMEOUT | 504 | Yes | Execution exceeded the allowed time budget. |
| AMOUNT_INVALID | 400 | No | The request payload failed this skill's input validation. |
| TOLERANCE_INVALID | 400 | No | The request payload failed this skill's input validation. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 KiB |
Limitations
- Does not fetch FX rates or convert currencies
- Does not infer materiality, accounting policy, cash rounding, or locale
- Does not accept unbounded lists or binary floating-point semantics
- When the amounts are in different currencies, or the tolerance type has not been chosen.
- Do not use when tolerance, scale, or rounding policy is still undecided
How to call
POST /v1/execute (requires authentication)
{
"skillKey": "money.compare_with_tolerance",
"input": {
"right": "100.01",
"tolerance": "0.02",
"left": "100.00",
"toleranceType": "absolute"
}
}Examples
Compare with a two-cent absolute tolerance
{
"right": "100.01",
"tolerance": "0.02",
"left": "100.00",
"toleranceType": "absolute"
}{
"referenceSide": "max",
"difference": "0.01",
"withinTolerance": true,
"toleranceType": "absolute",
"limit": "0.02"
}Compare with ten basis points of the larger magnitude
{
"right": "100.05",
"tolerance": "10",
"left": "100",
"toleranceType": "basis_points"
}{
"referenceSide": "max",
"difference": "0.05",
"withinTolerance": true,
"toleranceType": "basis_points",
"limit": "0.10005"
}Recommended use cases
- When you judge two amounts on the same unit basis inside an explicit absolute, relative, or basis-point band.
- Use for auditable ledger arithmetic with explicit monetary units
Avoid for
- When the amounts are in different currencies, or the tolerance type has not been chosen.
- Do not use when tolerance, scale, or rounding policy is still undecided
Related skills
Composable with
Safety & privacy
- Runs without calling any external service.
- Your payloads are never stored permanently.
- Telemetry captures metadata only — never your payload contents.
- We never train models on your payloads.
- No human reviews your payloads.