Agent skill

REST Call From JSON

by mendixlabs in mendixlabs/mxcli

Generate the whole integration stack from a JSON payload: JSON structure, non-persistent entities, import mapping, and the REST CALL microflow.

Apache-2.0Auto-check passed

Install REST Call From JSON

skills CLI
$ npx skills add mendixlabs/mxcli --skill rest-call-from-json -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install mendixlabs/mxcli rest-call-from-json --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/mendixlabs/mxcli.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/mendix/rest-call-from-json .claude/skills/rest-call-from-json && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
rest-call-from-json
GitHub stars
128
Token cost
~3.5k tokens
SKILL.md length
1,017 words
Files
1
Skills in repo
75
Repo updated
First seen
Licence
Apache-2.0

At a glance

Generate the whole integration stack from a JSON payload: JSON structure, non-persistent entities, import mapping, and the REST CALL microflow.

  • Works in 6 steps: JSON Structure → Non-Persistent Entities → Import Mapping → …
  • Starting from an example response and needing everything between it and a working microflow
  • SKILL.md covers Overview — Four Steps, Step 1 — JSON Structure, Step 2 — Non-Persistent Entities and Step 3 — Import Mapping, plus 6 more sections
  • Reaches bible-api.com

What it does

REST Call From JSON is an agent skill from mendixlabs/mxcli. Generate the whole integration stack from a JSON payload: JSON structure, non-persistent entities, import mapping, and the REST CALL microflow. Use when starting from an example response and needing everything between it and a working microflow.

Its SKILL.md is about 3.5k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: Mendix cli tool, a headless way to work with Mendix projects. Enables Mendix projects for use with 3rd party agentic coding tools like Claude Code and Copilot. Includes a… The licence is Apache-2.0.

When your agent uses it

  • Starting from an example response and needing everything between it and a working microflow

Example prompts

  • “/rest-call-from-json”

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. JSON Structure
  2. Non-Persistent Entities
  3. Import Mapping
  4. REST CALL Microflow
  5. Import/Export Mapping in Microflows (Optional)
  6. Sending a Request Body (Optional)

What it can do on your machine

Read from SKILL.md and the folder at commit a924d11. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are sql).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • bible-api.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

REST Call From JSON loads about 3.5k tokens when it runs. Until then it costs about 66 tokens; SKILL.md has 1,017 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~66
When it runs · the whole SKILL.md, loaded when a task matches
~3.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from mendixlabs/mxcli at commit a924d11, republished under its Apache-2.0 licence (© mendixlabs). 1,017 words, ~3,452 tokens.

Download SKILL.mdSave it as .claude/skills/rest-call-from-json/SKILL.md (or your agent's skills folder).
name
rest-call-from-json
description
Generate the whole integration stack from a JSON payload: JSON structure, non-persistent entities, import mapping, and the REST CALL microflow. Use when starting from an example response and needing everything between it and a working microflow.

REST Call from JSON Payload — End-to-End Skill

Use this skill to generate the full stack of Mendix integration artifacts from a JSON payload: JSON Structure → Non-persistent entities → Import Mapping → microflow.

Two approaches: This skill uses the inline REST CALL approach (good for one-off calls and quick prototyping). For structured APIs with reusable operations, use the REST Client approach instead — see rest-client for create consumed rest service + send rest request

  • optional transform with JSLT data transformers.

Overview — Four Steps

  1. CREATE JSON STRUCTURE — store the raw payload and derive the element tree
  2. CREATE ENTITY (non-persistent) — one per JSON object type, with attributes per JSON field
  3. CREATE IMPORT MAPPING — link JSON structure elements to entities and attributes
  4. CREATE MICROFLOW — inline REST CALL that invokes the import mapping (or use REST Client + SEND REST REQUEST)

Step 1 — JSON Structure

sql
mdl 1;
create json structure Module.JSON_MyStructure
  sample '{"key": "value", "count": 1}';
  • The executor formats the snippet (pretty-print) then refreshes (derives element tree) automatically.
  • The snippet must be valid JSON; use single quotes around it in MDL.
  • Escape single quotes inside the snippet by doubling them: ''.
  • The derived element tree must stay consistent with the snippet — the executor sorts JSON object keys alphabetically to match json.MarshalIndent output.

Verify after creation:

sql
describe json structure Module.JSON_MyStructure;
-- Should show: element tree under "-- Element tree:" comment

Step 2 — Non-Persistent Entities

Derive one entity per JSON object type. Name them after what they represent (not after JSON keys).

sql
mdl 1;
create non-persistent entity Module.MyRootObject (
  stringField   : string,
  intField      : integer,
  decimalField  : decimal,
  boolField     : boolean default false
);

create non-persistent entity Module.MyNestedObject (
  name : string,
  code : string
);

create association Module.MyRootObject_MyNestedObject
  from Module.MyRootObject
  to Module.MyNestedObject;

Rules:

  • All string fields: bare string (no length — unlimited)
  • All number fields: integer, decimal, or long — remove defaults for optional fields
  • Boolean fields require default true|false
  • non-persistent — these entities are not stored in the database. The keyword is hyphenated and goes before entity: create non-persistent entity Mod.X (...). NON_PERSISTENT, and a (NON_PERSISTENT) inside the body, are both parse errors
  • One association per parent→child relationship; name it Parent_Child

Step 3 — Import Mapping

Full reference: See json-structures-and-mappings for complete import/export mapping syntax, domain model patterns, and common mistakes.

sql
mdl 1;
create import mapping Module.IMM_MyMapping
  with json structure Module.JSON_MyStructure
{
  create Module.MyRootObject {
    stringField = stringField,
    intField    = intField,
    create Module.MyRootObject_MyNestedObject/Module.MyNestedObject = nestedKey {
      name = name,
      code = code
    }
  }
};

Syntax rules:

  • Root object: create Module.Entity { ... } — always starts with handling keyword
  • Value mappings: attributename = jsonFieldName — entity attribute on the left, JSON field on the right
  • Nested objects: create association/entity = jsonKey { ... } — association path + JSON key
  • Object handling: create (default), find (requires KEY), find or create
  • KEY marker: attr = jsonField key — marks the attribute as a matching key
  • Value transforms: attr = Module.Microflow(jsonField) — call a microflow to transform the value

Verify after creation — check Schema elements are ticked in Studio Pro:

  • Open the import mapping in Studio Pro
  • All JSON structure elements should appear ticked in the Schema elements panel
  • If not ticked: JsonPath mismatch between import mapping and JSON structure elements

Step 4 — REST CALL Microflow

Place the microflow in the [pages]/Operations/ folder or Private/ depending on whether it is public.

sql
create microflow Module.GET_MyData ()
begin
  @position(-5, 200)
  declare $baseUrl string = 'https://api.example.com';
  @position(185, 200)
  declare $endpoint string = $baseUrl + '/path';
  @position(375, 200)
  $Result = call rest service get '{1}' with ({1} = $endpoint) (
    Headers: ('Accept': 'application/json'),
    Timeout: 300,
  ) returns mapping Module.IMM_MyMapping as Module.MyRootObject on error rollback;
  @position(565, 200)
  log info node 'Integration' 'Retrieved result' with ();
end;
/

Key points:

  • @position annotations control the canvas layout — StartEvent is auto-placed 150px to the left of the first annotated activity
  • The output variable name is automatically derived from the entity name in as Module.MyEntity — do NOT hardcode it on the left side; the executor overrides it
  • Single vs list result is automatically detected: if the JSON structure's root element is an Object, the variable type is ObjectType (single); if Array, ListType (list)
  • on error rollback — standard error handling for integration calls

For list responses (JSON root is an array):

sql
  $Results = call rest service get '{1}' with ({1} = $endpoint) (
    Headers: ('Accept': 'application/json'),
    Timeout: 300,
  ) returns mapping Module.IMM_MyMapping as Module.MyItem on error rollback;
  @position(565, 200)
  $count = count $MyItem;

Step 5 — Import/Export Mapping in Microflows (Optional)

Instead of using returns mapping on a REST CALL, you can use standalone import/export mapping actions. This is useful when you already have a JSON string and want to map it to entities, or when you want to serialize entities back to JSON.

Import from mapping

Applies an import mapping to a string variable (JSON content) to produce entity objects:

sql
-- With assignment (non-persistent entities, need the result in the flow)
$PetResponse = import from mapping Module.IMM_Pet($JsonContent);

-- Without assignment (persistent entities, just stores to DB)
import from mapping Module.IMM_Pet($JsonContent);
Export to mapping

Applies an export mapping to an entity object to produce a JSON string:

sql
$JsonOutput = export to mapping Module.EMM_Pet($PetResponse);
Complete import → process → export microflow
sql
mdl 1;
create microflow Module.ProcessPetData ()
begin
  declare $ResponseContent string = $latestHttpResponse/content;
  $PetResponse = import from mapping Module.IMM_Pet($ResponseContent);
  -- Process the imported data...
  $JsonOutput = export to mapping Module.EMM_Pet($PetResponse);
  log info node 'Integration' 'Exported: ' + $JsonOutput;
end;

Show full SKILL.md (408 more words)Show less

Step 6 — Sending a Request Body (Optional)

Everything above receives data. To send it, an inline call rest service takes a Body: in its settings list, in one of four forms:

sql
-- 1. String template with placeholders
Body: template '{{"name": "{1}", "qty": {2}}' with ({1} = $Name, {2} = toString($Qty))

-- 2. An expression that already yields the payload
Body: $JsonPayload

-- 3. An export mapping (entity -> JSON)
Body: mapping Module.EMM_Item from $Item

-- 4. Raw bytes — a file document's CONTENTS member
Body: binary $Doc/Contents

The settings list goes after the URL, with the other dialog settings:

sql
$Response = call rest service post 'https://api.example.com/items' (
  Headers: ('Content-Type': 'application/json'),
  Body: mapping Module.EMM_Item from $Item,
  Timeout: 60,
) returns response;
Uploading a file

The expression is the file document's Contents member, not the document, and the content type goes on a header — the body clause carries only the bytes:

sql
mdl 1;
create or modify microflow Module.POST_Document_Upload (
  $Doc: Module.UploadedFile
)
returns boolean as $Ok
begin
  declare $Ok boolean = false;
  $Response = call rest service post 'https://api.example.com/documents' (
    Headers: ('ContentType': 'application/pdf'),
    Body: binary $Doc/Contents,
    Timeout: 300,
  ) returns response;
  set $Ok = $Response/StatusCode = 200;
  return $Ok;
end;

$Doc must be a specialization of System.FileDocument. Downloading is the mirror image — returns Module.UploadedFile stores the response body in a new file document.

A consumed REST CLIENT document cannot do this. Its body is one of Rest$JsonBody, Rest$StringBody or Rest$ImplicitMappingBody — all textual — so Body: file from $Doc in a create consumed rest service operation is refused as MDL-REST02. Binary uploads belong in a microflow. (Response: file as $Doc on an operation is fine; downloads work either way.)


Complete Example — Bible Verse API

sql
-- Step 1: JSON Structure
create json structure Integrations.JSON_BibleVerse
  sample '{"translation":{"identifier":"web","name":"World English Bible","language":"English","language_code":"eng","license":"Public Domain"},"random_verse":{"book_id":"1SA","book":"1 Samuel","chapter":17,"verse":49,"text":"David put his hand in his bag, took a stone, and slung it."}}';

-- Step 2: Entities
create non-persistent entity Integrations.BibleApiResponse ();

create non-persistent entity Integrations.BibleTranslation (
  identifier    : string,
  name          : string,
  language      : string,
  language_code : string,
  license       : string
);

create non-persistent entity Integrations.BibleVerse (
  book_id : string,
  book    : string,
  chapter : integer,
  verse   : integer,
  text    : string
);

create association Integrations.BibleApiResponse_BibleTranslation
  from Integrations.BibleApiResponse
  to Integrations.BibleTranslation;

create association Integrations.BibleApiResponse_BibleVerse
  from Integrations.BibleApiResponse
  to Integrations.BibleVerse;

-- Step 3: Import Mapping
create import mapping Integrations.IMM_BibleVerse
  with json structure Integrations.JSON_BibleVerse
{
  create Integrations.BibleApiResponse {
    create Integrations.BibleApiResponse_BibleTranslation/Integrations.BibleTranslation = translation {
      identifier    = identifier,
      language      = language,
      language_code = language_code,
      license       = license,
      name          = name
    },
    create Integrations.BibleApiResponse_BibleVerse/Integrations.BibleVerse = random_verse {
      book    = book,
      book_id = book_id,
      chapter = chapter,
      text    = text,
      verse   = verse
    }
  }
};

-- Step 4: Microflow
create microflow Integrations.GET_BibleVerse_Random ()
begin
  @position(-5, 200)
  declare $baseUrl string = 'https://bible-api.com';
  @position(185, 200)
  declare $endpoint string = $baseUrl + '/data/web/random';
  @position(375, 200)
  $Result = call rest service get '{1}' with ({1} = $endpoint) (
    Headers: ('Accept': 'application/json'),
    Timeout: 300,
  ) returns mapping Integrations.IMM_BibleVerse as Integrations.BibleApiResponse on error rollback;
  @position(565, 200)
  log info node 'Integration' 'Retrieved Bible verse' with ();
end;
/

Gotchas and Common Errors

SymptomCauseFix
Studio Pro "not consistent with snippet"JSON element tree keys not in alphabetical orderExecutor sorts keys; re-derive from snippet
Schema elements not ticked in import mappingJsonPath mismatchNamed object elements use (object)|key, NOT (object)|key|(object)
Import mapping not linked in REST callWrong BSON field nameUse ReturnValueMapping, not mapping
Studio Pro shows "List of X" but mapping returns single XForceSingleOccurrence not setExecutor auto-detects from JSON structure root element type
StartEvent behind first activitiesDefault posX=200 vs @position(-5,...)Fixed: executor pre-scans for first @position and shifts StartEvent left
TypeCacheUnknownTypeExceptionWrong BSON $type namesImportMappings$ObjectMappingElement / ImportMappings$ValueMappingElement (no import prefix)
Attribute not found in Studio ProAttribute not fully qualifiedMust be Module.Entity.AttributeName in the BSON
CE0117 "Error(s) in expression." at the end event after a REST callreturns response binds a System.HttpResponse, so returning it from a returns string microflow is a type errorMatch the microflow's return type to what you do with the response — e.g. returns boolean and set $Ok = $Response/StatusCode = 200
Upload returns HTTP 200 but the server received a few bytesBody: file from $Doc on a REST CLIENT document used to be written as the literal text $DocNow refused as MDL-REST02 — upload from a microflow with body binary $Doc/Contents

Naming Conventions (MES)

ArtifactPatternExample
JSON StructureJSON_<ApiName>JSON_BibleVerse
Import MappingIMM_<ApiName>IMM_BibleVerse
Root entityDescribes the API responseBibleApiResponse
Nested entitiesDescribes the domain conceptBibleVerse, BibleTranslation
MicroflowMETHOD_Resource_OperationGET_BibleVerse_Random
FolderPrivate/ for mappings/structures, Operations/ for public microflows—

© mendixlabs, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/mendix/rest-call-from-json of mendixlabs/mxcli.

Open the folder on GitHubat commit a924d11

Compare with similar skills

REST Call From JSON next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

REST Call From JSON compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
REST Call From JSON this skillmendixlabs/mxcli128—~3.5kAutomated safety check: PassApache-2.0
Payloadpayloadcms/payload45k5 repos~6.2kAutomated safety check: PassMIT
Agentmemory REST APIrohitg00/agentmemory29k—~404Automated safety check: PassApache-2.0
Payload Accessibilitypayloadcms/payload45k—~808Automated safety check: PassMIT
Phoenix REST APIArize-ai/phoenix12k—~286Automated safety check: PassCustom licence
Onesignal REST API AutomationComposioHQ/awesome-claude-skills77k3 repos~754Automated safety check: PassNone

Similar skills

  • Payload

    payloadcms/payload

    A skill your agent uses when working with Payload projects (payload.config.ts, collections, fields, hooks, access control, Payload API).

    45k GitHub starsUsed in 5 repos~6.2k tokens
    Backend & APIsAuto-check passed
  • Agentmemory REST API

    rohitg00/agentmemory

    Covers the HTTP REST endpoints of the agentmemory server, its primary interface, for hosts without MCP or when MCP is unavailable.

    29k GitHub stars~404 tokensUpdated today
    Backend & APIsAuto-check passed
  • Payload Accessibility

    payloadcms/payload

    A skill your agent uses when changing or reviewing rendered Payload UI, interaction or focus behavior, semantic markup, accessibility tests, or WCAG/VPAT evidence.

    45k GitHub stars~808 tokensUpdated today
    Frontend & DesignAuto-check passed
  • Phoenix REST API

    Arize-ai/phoenix

    REST API development for Phoenix. An agent skill from Arize-ai/phoenix.

    12k GitHub stars~286 tokensUpdated today
    Backend & APIsAuto-check passed
  • Onesignal REST API Automation

    ComposioHQ/awesome-claude-skills

    Automate OneSignal tasks via Rube MCP (Composio). An agent skill from ComposioHQ/awesome-claude-skills.

    77k GitHub starsUsed in 3 repos~754 tokens
    Productivity & AutomationAuto-check passed
  • Shorten REST Automation

    ComposioHQ/awesome-claude-skills

    Automate Shorten Rest tasks via Rube MCP (Composio). An agent skill from ComposioHQ/awesome-claude-skills.

    77k GitHub starsUsed in 3 repos~749 tokens
    Productivity & AutomationAuto-check passed

More from mendixlabs/mxcli

All 75 skills in this repo
  • Mendix Odata Pushdown

    mendixlabs/mxcli

    Push OData query options into the SQL of a Mendix resource served by a read microflow, so $filter, $orderby, $top, $skip, $count and the key lookup reach the database instead of being silently…

    128 GitHub stars~2.5k tokensUpdated today
    Auto-check passed
  • Mendix Vega Charts

    mendixlabs/mxcli

    Chart a Mendix app with Vega-Lite through a pluggable widget that takes the specification and the data as separate properties, so the model emits rows and never assembles a chart payload.

    128 GitHub stars~3k tokensUpdated today
    Auto-check passed
  • Agents

    mendixlabs/mxcli

    Author Mendix AI agent documents in MDL — Model, Knowledge Base, Consumed MCP Service and Agent, with variables, tools and multi-line prompts.

    128 GitHub starsUsed in 1 repo~2.2k tokens
    Auto-check passed
  • Mendix Bulk Oql Dml

    mendixlabs/mxcli

    Run set-based INSERT, UPDATE and DELETE against Mendix entities through OQL statements, which the runtime supports and Studio Pro cannot author.

    128 GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Mock REST APIs

    mendixlabs/mxcli

    Stand up an HTTP endpoint you control instead of a live third-party API, and point the Mendix app at it — Prism from an OpenAPI contract, a constant swap, or a forward proxy.

    128 GitHub starsUsed in 1 repo~2.5k tokens
    Auto-check passed
  • REST Client

    mendixlabs/mxcli

    Call external REST APIs from Mendix — the three approaches (inline REST CALL, consumed REST client document, generated from OpenAPI) and how to choose.

    128 GitHub starsUsed in 1 repo~3.9k tokens
    Auto-check passed

Questions about REST Call From JSON

What does REST Call From JSON do?

Generate the whole integration stack from a JSON payload: JSON structure, non-persistent entities, import mapping, and the REST CALL microflow. REST Call From JSON is an agent skill from mendixlabs/mxcli. Generate the whole integration stack from a JSON payload: JSON structure, non-persistent entities, import mapping, and the REST CALL microflow.

When should I use REST Call From JSON?

REST Call From JSON fits situations like: starting from an example response and needing everything between it and a working microflow.

How do I install REST Call From JSON in Claude Code?

Run `npx skills add mendixlabs/mxcli --skill rest-call-from-json -a claude-code`. Or copy the skill folder (.claude/skills/mendix/rest-call-from-json in mendixlabs/mxcli) into .claude/skills/rest-call-from-json in your project. Claude Code loads it when a task matches its description.

How do I install REST Call From JSON in Codex?

Run `npx skills add mendixlabs/mxcli --skill rest-call-from-json -a codex`. Or copy the skill folder (.claude/skills/mendix/rest-call-from-json in mendixlabs/mxcli) into .agents/skills/rest-call-from-json in your project. Codex loads it when a task matches its description.

Can I use REST Call From JSON in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add mendixlabs/mxcli --skill rest-call-from-json -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/rest-call-from-json, .gemini/skills/rest-call-from-json, .github/skills/rest-call-from-json and .opencode/skills/rest-call-from-json in your project.

What does REST Call From JSON need to run?

SKILL.md names no scripts, command-line tools or credentials: REST Call From JSON is instructions for the agent only.

Does REST Call From JSON access the network?

SKILL.md names 1 domain. In commands or code: bible-api.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is REST Call From JSON safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does REST Call From JSON use?

REST Call From JSON is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does REST Call From JSON use?

About 3.5k tokens (SKILL.md is roughly 14k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to REST Call From JSON?

Skills that share tags, products or a category with REST Call From JSON: Payload (payloadcms/payload, 45k stars), Agentmemory REST API (rohitg00/agentmemory, 29k stars), Payload Accessibility (payloadcms/payload, 45k stars) and Phoenix REST API (Arize-ai/phoenix, 12k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains REST Call From JSON?

mendixlabs (a GitHub organization) maintains it in mendixlabs/mxcli, which has 128 GitHub stars. The repository holds 75 skills in this directory. The repository was last updated on October 7, 2026.

Source: mendixlabs/mxcli on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.