Skip to main content
Glama

Create a JS object

appsmith_create_js_object

Create a new JS object in Appsmith by providing its full source code, application ID, page ID, and name so that exported functions become callable within the application.

Instructions

Creates a JS object from its source. The exported functions are parsed out of the body — Appsmith stores each one separately, and the source alone would produce an object with no callable functions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyYesFull source, of the form "export default { ... }".
nameYesJS object name, as referenced in bindings (e.g. JSObject1).
pageIdYesPage the JS object belongs to.
applicationIdYesApplication id.
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It discloses a subtle behavior — that exported functions are stored separately and the source alone produces an object with no callable functions — which is genuinely non-obvious and valuable behavioral insight not captured anywhere else. It doesn't mention auth/permission requirements or exact side effects of creation validation, but the key behavioral quirk is well disclosed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a tight two-sentence structure with the behavioral caveat front-loaded. Every sentence earns its place — the first states the action and the second explains the parsed-exports behavior. Minor waste: the phrase 'Creates a JS object from its source' slightly restates the name, but combined with the second sentence it's efficient and focused.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a creation tool with 100% schema coverage and no output schema, the description is complete for the main task. It explains the format requirement, the parsing behavior, and the naming convention. It doesn't discuss validation failures or permissions, but those aren't strictly required for invoking it correctly. The key quirk that would surprise an agent (functions being stored separately) is fully covered.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already documents all four parameters (body, name, pageId, applicationId). The description adds value by specifying the required source form ('export default { ... }') and explaining that name is referenced in bindings, which slightly exceeds schema. With full schema coverage, baseline 3 is appropriate; the description genuinely enhances understanding of body and name beyond schema text.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb (creates), resource (JS object from its source), and adds crucial distinguishing detail about how exported functions are parsed out of the body. It contrasts against siblings like appsmith_create_query and appsmith_create_page, and its companion appsmith_update_js_object. The behavioral insight that 'the source alone would produce an object with no callable functions' makes the purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description doesn't explicitly name alternatives or exclusions, but it does convey essential usage context: this tool creates a JS object, and the format requirement ('export default { ... }') plus the parsing behavior implies when to use it (creating JS objects) versus updating them. It lacks explicit when-not-to-use guidance or mention of appsmith_update_js_object as an alternative, but the context is reasonably clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Davidgraciano/appsmith-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server