Agent Skill · codefmt

format-code

Format and lint JavaScript, Python, and HubL code for automation platforms (Zapier, n8n, Pipedream, Make, HubSpot). Wraps code in each platform's runtime shell so standard formatters don't break on top-level await, bare return, or injected globals.

Provider: codefmt Path in repo: format-code/SKILL.md

Skill body

format-code

Use this skill when a user wants formatted or lint-checked code for a code-step inside an automation platform: Zapier “Code by Zapier”, n8n Code node, Pipedream actions/sources, Make Custom JS/Python, HubSpot Data Hub, or HubSpot CMS (HubL templates).

When to use

How to invoke

Option A — JSON API

curl -sS https://codefmt.dev/api/format \
  -H 'content-type: application/json' \
  --data @- <<'JSON'
{
  "code": "const name=inputData.name\nreturn {greeting:\"hi \"+name}",
  "platform": "zapier",
  "formatOptions": {
    "printWidth": 80,
    "tabWidth": 2,
    "useTabs": false,
    "endOfLine": "lf",
    "semicolons": true,
    "quoteStyle": "single",
    "trailingCommas": "all",
    "bracketSpacing": true,
    "arrowParens": "always",
    "singleAttributePerLine": false,
    "objectWrap": "preserve",
    "quoteProperties": "as-needed",
    "jsxQuoteStyle": "double",
    "bracketSameLine": false,
    "organizeImports": false
  },
  "lintOptions": {
    "enabled": true,
    "severity": "default",
    "typescriptPlugin": false,
    "reactPlugin": false,
    "unicornPlugin": false,
    "promisePlugin": true,
    "nodePlugin": true,
    "securityPlugin": true,
    "perfCategory": false,
    "noConsole": false
  }
}
JSON

All four of code, platform, formatOptions and lintOptions are required and have no server-side defaults, so dropping either option block is a 400 and not a fallback. Swap platform for any id in the Inputs list. For python, add pythonFormatOptions + pythonLintOptions and set platformVariants.language to python; for hubl, add hublFormatOptions. Complete bodies for all three: https://codefmt.dev/llms-full.txt

Full request/response schema: https://codefmt.dev/api/openapi.json Parameter reference: https://codefmt.dev/llms.txt

Option B — MCP tool

Connect to https://codefmt.dev/api/mcp (Streamable HTTP, protocols 2026-07-28, 2025-11-25, 2025-06-18, 2025-03-26) and call the format_code tool with { code, platform, language? }. Server card: https://codefmt.dev/.well-known/mcp/server-card.json.

Claude Code (run once in a terminal):

claude mcp add --transport http codefmt https://codefmt.dev/api/mcp

Claude Desktop and claude.ai (Settings > Connectors > Add custom connector, with this URL; calls come from Anthropic’s servers, so the per-ip rate limit is shared with other connector users):

https://codefmt.dev/api/mcp

Cursor (add to ~/.cursor/mcp.json (or .cursor/mcp.json in a project)):

{
  "mcpServers": {
    "codefmt": {
      "url": "https://codefmt.dev/api/mcp"
    }
  }
}

VS Code (add to .vscode/mcp.json):

{
  "servers": {
    "codefmt": {
      "type": "http",
      "url": "https://codefmt.dev/api/mcp"
    }
  }
}

Option C — WebMCP (in-browser)

When codefmt.dev is open in a browser with WebMCP enabled (document.modelContext, Chrome 150 or later), the page registers the MCP server’s three tools (format_code, format_json and ask_codefmt), so an agent driving that page can call them without an MCP connection. WebMCP is not on by default in Chrome: it comes through Chrome’s WebMCP origin trial, which codefmt.dev has joined, or through the chrome://flags/#enable-webmcp-testing flag for local testing.

Inputs

Output

Option A (POST /api/format) returns the formatted source under code:

{
  "code": "<formatted source>",
  "diagnostics": [
    { "line": 3, "column": 12, "severity": "warning", "message": "...", "rule": "..." }
  ],
  "duration": 12
}

code, diagnostics and duration are always present. Most paths also return diagnosticsFrame ("input" or "output"), saying whether diagnostic positions point at the source you sent or at the formatted output, and error (a string) appears only on a partial failure. There is no formatted_code field on this endpoint.

Options B and C (the MCP / WebMCP format_code tool) return the agent-tool shape instead: the formatted source is formatted_code, and error is always present as a string or null.

{
  "formatted_code": "<formatted source>",
  "diagnostics": [
    { "line": 3, "column": 12, "severity": "warning", "message": "...", "rule": "..." }
  ],
  "diagnostics_frame": "output",
  "error": null
}

Limits

Work with this as data

Every skill here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for agent skills

4 MCP tools reach this
  • find_skillsBrowse and filter every skill in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This skill
curl "https://apis.io/api/v1/skills/format-code"
All agent skills
curl "https://apis.io/api/v1/skills?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.