← Back to Catalog

CSV Import Rehearsal

ID: F128 | Version: 0.1.0

Tool: rehearse_csv_import

Simulate a CSV import against a supplied typed column contract and return exact accepted rows, rejected rows, proposed normalizations and formula-risk cells. The rehearsal never writes an import destination.

Pricing

0.03 per analysis

Requires x402 capable MCP client with wallet for payment settlement.

Input Schema

{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "csv",
    "columns"
  ],
  "properties": {
    "csv": {
      "type": "string"
    },
    "delimiter": {
      "type": "string",
      "enum": [
        ",",
        ";",
        "\t"
      ]
    },
    "columns": {
      "type": "array",
      "minItems": 1,
      "maxItems": 50,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "type"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "type": {
            "type": "string",
            "enum": [
              "string",
              "integer",
              "decimal",
              "boolean",
              "date"
            ]
          },
          "required": {
            "type": "boolean"
          },
          "trim": {
            "type": "boolean"
          },
          "enum": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "minItems": 1
          }
        }
      }
    },
    "allow_extra_columns": {
      "type": "boolean"
    }
  }
}

Example Input

{
  "csv": "id,name,amount,active,when\n1,\"Doe, Jane\",012.50,true,2024-02-29\n2, ,-3,false,2023-02-29\n",
  "columns": [
    {
      "name": "id",
      "type": "string"
    },
    {
      "name": "name",
      "type": "string",
      "trim": true,
      "required": true
    },
    {
      "name": "amount",
      "type": "decimal"
    },
    {
      "name": "active",
      "type": "boolean"
    },
    {
      "name": "when",
      "type": "date"
    }
  ]
}

Example Output

{
  "ok": true,
  "summary": {
    "rows": 2,
    "accepted": 1,
    "rejected": 1
  },
  "headers": [
    "id",
    "name",
    "amount",
    "active",
    "when"
  ],
  "rows": [
    {
      "index": 1,
      "accepted": true,
      "values": {
        "id": "1",
        "name": "Doe, Jane",
        "amount": "12.50",
        "active": true,
        "when": "2024-02-29"
      },
      "errors": []
    },
    {
      "index": 2,
      "accepted": false,
      "values": {
        "id": "2",
        "name": null,
        "amount": "-3",
        "active": false,
        "when": null
      },
      "errors": [
        {
          "column": "name",
          "code": "required_missing",
          "message": "required value is blank",
          "line": 3
        },
        {
          "column": "when",
          "code": "type_mismatch",
          "message": "expected a valid YYYY-MM-DD date",
          "line": 3
        }
      ]
    }
  ],
  "corrections": [
    {
      "row": 1,
      "column": "amount",
      "before": "012.50",
      "after": "12.50",
      "reason": "normalized decimal format"
    },
    {
      "row": 2,
      "column": "name",
      "before": " ",
      "after": "",
      "reason": "trimmed whitespace"
    }
  ],
  "formula_cells": []
}

Limitations

Connect via MCP

Add to your MCP client configuration:

{
  "mcpServers": {
    "csv-import-rehearsal": {
      "type": "http",
      "url": "https://mcp-factory.bowling-anthony.workers.dev/csv-import-rehearsal/mcp"
    }
  }
}

Payment

Price: 0.03 USDC per analysis

This tool requires an x402-capable MCP client with wallet support. Tool listing and initialization are free. Actual completed job analysis is paid in USDC on the Base network.

Payment flow:

  1. Client discovers the price, then submits a signed x402 v2 PAYMENT-SIGNATURE authorization with the input
  2. If settlement is pending, retry the identical input and authorization; do not sign another charge.
  3. Results retained for 24 hours for recovery
  4. Maximum output size: 96 KiB