Skip to main content
Glama
jim-agent

NEAR Contract Deployer MCP Server

by jim-agent

upgrade_contract

Upgrade a NEAR contract by deploying new WASM code, with optional post-upgrade migration. Requires signer ownership of the contract.

Instructions

Upgrade an existing contract with new WASM code. The contract must be owned by the signer.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
networkNoNEAR network (default: testnet)
wasm_pathNoPath to the new compiled WASM file
contract_idYesThe NEAR account ID of the contract to upgrade
private_keyNoOptional: Private key for signing
wasm_base64NoAlternative: Base64-encoded new WASM bytes
migrate_argsNoOptional: Arguments for migration method
migrate_methodNoOptional: Migration method to call after upgrade (e.g., "migrate")
Behavior3/5

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

No annotations are present, so the description carries the burden of behavioral disclosure. It discloses the ownership requirement ('must be owned by the signer') and implies code replacement, but omits details on irreversibility, migration invocation, state persistence, or potential failure modes.

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

Conciseness5/5

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

Two concise sentences with no redundant phrasing. The purpose is front-loaded, and the ownership constraint is stated efficiently.

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

Completeness2/5

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

For a complex operation with 7 parameters and no output schema, this description is too minimal. It lacks guidance on when to use wasm_path versus wasm_base64, how migration methods are invoked, and what outcome the agent should expect after calling the tool.

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 description coverage is 100%, so each parameter is already documented. The description only loosely references WASM code and ownership, adding little beyond the schema. Baseline 3 is appropriate because the schema does the heavy lifting.

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 tool's action ('Upgrade an existing contract') and its resource ('with new WASM code'), which distinguishes it from sibling tools like deploy_contract targeting new contracts. The phrase 'existing contract' reinforces the intended use case.

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 gives clear context that this tool is for existing contracts and includes an ownership prerequisite, but it does not explicitly contrast with deploy_contract or mention when migration arguments are relevant. No direct exclusions or alternative names are provided.

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/jim-agent/mcp-near-deploy'

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