Skip to main content
Glama

Run Code

run_code

Executes code snippets in 24 languages on HackerEarth's cloud servers and returns printed output or errors. Requires HACKEREARTH_KEY; use to test code and see real output.

Instructions

Executes a snippet of code on HackerEarth's cloud servers in any of 24 languages. Use when the user wants to test code, see real output instead of predicted output, or check whether a program works. Needs the code and the language identifier, call list_languages if unsure of the exact name. Requires HACKEREARTH_KEY to be set; every run consumes the key owner's HackerEarth API quota. Returns the program's printed output and any error messages.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
languageYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations provided, the description carries the full behavioral burden and does so well: it discloses remote execution on HackerEarth servers, the HACKEREARTH_KEY prerequisite, and the fact that each run consumes the key owner's API quota (a real cost/rate signal). It also describes the returned artifacts (printed output and error messages), which is more than the annotations would have supplied.

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?

Four sentences, front-loaded with the core action and scope before prerequisites and return values. Slight redundancy in the trigger list ('see real output' and 'check whether a program works' overlap), but no filler sentences.

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?

Covers purpose, triggers, prerequisites, cost, and (briefly) output for a two-parameter tool that already ships an output schema. It omits execution constraints such as runtime/memory limits or sandbox restrictions, which matter for a remote code-execution tool, but the essentials for correct invocation are present.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must compensate, and it does: it names both required inputs (code, language identifier) and routes the agent to list_languages for resolving the language value. It stops short of giving format or size constraints for the code payload, so it is not exhaustive.

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?

States a specific verb and resource (executes a code snippet) plus scope (HackerEarth cloud servers, 24 languages), which cleanly separates it from the sibling list_languages tool. An agent can tell what this tool does without opening the schema.

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

Usage Guidelines5/5

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

Gives explicit trigger conditions ('test code, see real output instead of predicted output, or check whether a program works') and names the alternative to consult when a prerequisite is unclear ('call list_languages if unsure of the exact name'). Nothing is left to inference about when to reach for this tool.

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

Deploy Server

Other Tools