# create_rate_rounding_rule

Create a named rate rounding rule in a workspace (stepUnits in whole major units, ending FRACTION with hundredths or
ONE_UNIT_UNDER without hundredths, direction DOWN, UP or NEAREST). The rule starts unassigned and reprices nothing.
Returns the new rule id. Create is not idempotent and is sent once, never retried: if the outcome is uncertain
(OUTCOME_UNKNOWN), reconcile by waiting about a minute, then calling list_rate_rounding_rules with the exact name
filter: rule names are not unique, so only treat the create as done if a new rule matching the name and the full
definition exists, otherwise ask the user before creating again.

<!-- INPUT_BLOCK_START -->

## Input

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `workspaceId` | `string` | Yes | The ID of the workspace the rule belongs to |
| `name` | `string` | Yes | Name of the rounding rule, 1 to 150 characters |
| `definition` | `RateRoundingDefinition` | Yes | [RateRoundingDefinition](#rateroundingdefinition) |

### RateRoundingDefinition

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `stepUnits` | `number` | Yes | Whole major currency units between allowed prices, 1 to 100 (never a decimal) |
| `ending` | `RateRoundingEnding` | Yes | Where an allowed price sits relative to each multiple of the step. Either { kind: "FRACTION", hundredths: 0 to 99 } or { kind: "ONE_UNIT_UNDER" } with no hundredths, which needs stepUnits above 1 - [RateRoundingEnding](#rateroundingending) |
| `direction` | `Direction` | Yes | How the starting price is picked - [Direction](#direction) |

### RateRoundingEnding

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `kind` | `Kind` | Yes | FRACTION: allowed prices end in a fixed fraction of a major unit (needs hundredths). ONE_UNIT_UNDER: allowed prices sit one major unit below each multiple of the step (needs stepUnits above 1, takes no hundredths). - [Kind](#kind) |
| `hundredths` | `number` | No | Only for FRACTION, where it is required: hundredths of a major currency unit the price ends in, 0 to 99 (99 means .99). Leave it out for ONE_UNIT_UNDER. |

### Direction

| Value | Description |
| --- | --- |
| `DOWN` | Pick the allowed price at or below the starting price |
| `UP` | Pick the allowed price at or above the starting price |
| `NEAREST` | Pick the closest allowed price; a tie takes the higher one |

### Kind

| Value | Description |
| --- | --- |
| `FRACTION` | Allowed prices end in a fixed fraction of a major unit, for example .99 |
| `ONE_UNIT_UNDER` | Allowed prices sit one major unit below each multiple of the step |

<!-- INPUT_BLOCK_END -->

<!-- OUTPUT_BLOCK_START -->

## Output

| Field | Type | Description |
| --- | --- | --- |
| `content` | `ContentItem[]` | Array of content items returned by the tool - [ContentItem](#contentitem) |
| `isError` | `boolean` | Whether the tool execution resulted in an error |

### ContentItem

| Field | Type | Description |
| --- | --- | --- |
| `type` | `'text'` | Content type (currently only 'text' is supported) |
| `text` | `string` | The text content to display |

<!-- OUTPUT_BLOCK_END -->
