# Truto Mapping Tester

> Test and debug Truto unified model mappings, JSONata response mappings, query/body/error mappings, environment overrides, and proxy-versus-unified mismatches with Truto CLI. Use for normalized data issues or mapping review.

- Skill: `yuvraj3335/truto-mapping-tester` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add yuvraj3335/truto-mapping-tester`
- Raw SKILL.md: https://api.skillmd.com/api/skills/yuvraj3335/truto-mapping-tester/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: yuvraj3335 (https://skillmd.com/u/yuvraj3335)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/yuvraj3335/truto-mapping-tester

---


# Truto Mapping Tester

## Mission

Prove whether a unified API issue is caused by raw provider data, base mapping, environment override, query/body mapping, error mapping, or runtime behavior.

## Inputs

Use any of: profile, account ID, model, resource, method, integration name, environment unified model ID, raw sample, query/body, mapping row ID, local mapping file, or failing unified output.

## Resolve Context

```bash
truto accounts get "$ACCOUNT_ID" -p "$PROFILE" -o json --no-color
truto capabilities "$ACCOUNT_ID" --target account --type unified -p "$PROFILE" -o json --no-color
truto env-unified-models list --unified-model-name "$MODEL" -p "$PROFILE" -o json --no-color
truto unified-model-mappings list --integration-name "$INTEGRATION" --resource-name "$RESOURCE" --method-name "$METHOD" -p "$PROFILE" -o json --no-color
truto env-unified-model-mappings list --environment-unified-model-id "$ENV_UNIFIED_MODEL_ID" --integration-name "$INTEGRATION" --resource-name "$RESOURCE" --method-name "$METHOD" -p "$PROFILE" -o json --no-color
```

If `ENV_UNIFIED_MODEL_ID` is unknown, infer it from `env-unified-models list` for the current profile environment.

## Build a Raw Sample

Capture raw provider data from the native proxy resource or a custom provider path:

```bash
truto proxy "$PROXY_RESOURCE" -m "$PROXY_METHOD" -a "$ACCOUNT_ID" --query-json "$QUERY_JSON" -p "$PROFILE" -o json --no-color > /tmp/truto-raw-sample.json
truto custom "$PATH" -m GET -a "$ACCOUNT_ID" --query-json "$QUERY_JSON" -p "$PROFILE" -o json --no-color > /tmp/truto-raw-sample.json
```

Use a small but representative payload. Avoid massive exports for mapping iteration.

## Offline Response Mapping

Local mapping:

```bash
truto unified test-mapping --mapping-file "$MAPPING_FILE" --input /tmp/truto-raw-sample.json --query-json "$QUERY_JSON" -p "$PROFILE" -o json --no-color --show-mapping
```

Platform mapping:

```bash
truto unified test-mapping --model "$MODEL" --resource "$RESOURCE" --integration "$INTEGRATION" --method "$METHOD" --input /tmp/truto-raw-sample.json --query-json "$QUERY_JSON" -p "$PROFILE" -o json --no-color --show-mapping
```

With environment overrides:

```bash
truto unified test-mapping --model "$MODEL" --resource "$RESOURCE" --integration "$INTEGRATION" --method "$METHOD" --with-overrides "$ENV_UNIFIED_MODEL_ID" --input /tmp/truto-raw-sample.json --query-json "$QUERY_JSON" -p "$PROFILE" -o json --no-color --show-mapping
```

## Runtime Compare

```bash
truto unified "$MODEL" "$RESOURCE" -m "$METHOD" -a "$ACCOUNT_ID" --query-json "$QUERY_JSON" -p "$PROFILE" -o json --no-color -v
```

If offline mapping succeeds but runtime fails, inspect query/body/error mappings, environment overrides, or platform logs.

## JSONata Checks

- Output must match the unified schema and avoid extra fields.
- Do not map missing values to `null` unless the schema expects it.
- Normalize singleton-vs-array cases.
- Convert dates to ISO strings for date/date-time fields.
- Use `$query` or `$rawQuery` only when the mapping needs request context.
- `test-mapping` is offline and currently focuses on `response_mapping`; do not treat it as proof of provider call behavior.

## Output

Return raw-sample source, mapping rows tested, offline result, runtime comparison, failing fields, root cause, and the smallest mapping or query/body change to test.

