Fixed width records slice

fixed-width-records-slice · version 1.0.0 · Structured formats · free, no key needed

Slice selected fixed-width fields with explicit offsets, Unicode units, padding checks, and bounded diagnostics.

Use when you need to: slice fixed width records · project selected positional fields · extract raw fixed record columns.

Decide before calling

Read the versioned contract and the supported scope below. Reuse fixed-width-records-slice@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 fixed-width-records-slice@1.0.0 for slice fixed width records. 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:

{
  "text": "ABCD",
  "fields": [
    {
      "name": "a",
      "offset": 0,
      "width": 2,
      "alignment": "none",
      "padding": " "
    },
    {
      "name": "b",
      "offset": 2,
      "width": 2,
      "alignment": "none",
      "padding": " "
    }
  ],
  "unit": "code_point",
  "line_endings": "lf",
  "field_names": [
    "b"
  ]
}

Response:

{
  "result": {
    "reference_version": "Python 3.13 str slicing; GNU Coreutils cut 9.7",
    "lines_in": 1,
    "records": [
      "CD"
    ],
    "errors": []
  }
}

How to call it

MCP

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

{
  "id": "fixed-width-records-slice",
  "version": "1.0.0",
  "input": {
    "text": "ABCD",
    "fields": [
      {
        "name": "a",
        "offset": 0,
        "width": 2,
        "alignment": "none",
        "padding": " "
      },
      {
        "name": "b",
        "offset": 2,
        "width": 2,
        "alignment": "none",
        "padding": " "
      }
    ],
    "unit": "code_point",
    "line_endings": "lf",
    "field_names": [
      "b"
    ]
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/fixed-width-records-slice/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"text":"ABCD","fields":[{"name":"a","offset":0,"width":2,"alignment":"none","padding":" "},{"name":"b","offset":2,"width":2,"alignment":"none","padding":" "}],"unit":"code_point","line_endings":"lf","field_names":["b"]}'

The machine-readable contract is at /v1/tools/fixed-width-records-slice/versions/1.0.0.

CLI

node cli.mjs run fixed-width-records-slice 1.0.0 --input input.json --base-url https://computefirst.net

Get the client at /clients/cli/.