@onecompiler/onecompiler-mcp-server
Version:
MCP Server for Onecompiler
30 lines (25 loc) • 1.6 kB
JavaScript
import { RunRequestSchema } from "./types.js";
const tools = [
{
method: "codeExec",
name: "Code Execution",
description: `
Executes code snippets in various programming languages via the OneCompiler environment and returns the standard output (stdout).
**Use Cases:**
* **Precise Calculations:** Mathematical operations (arithmetic, statistics like sum, average, median), financial modeling, scientific computations where accuracy is paramount.
* **Data Manipulation:** Text processing (counting words/characters/lines, regex matching, formatting), sorting or filtering data provided via stdin or within the code.
* **Algorithmic Tasks:** Implementing specific algorithms, running simple simulations, generating patterned data.
* **Tasks Requiring Specific Libraries:** When a task benefits from standard libraries available in languages like Python or JavaScript.
**When to Use:**
Choose this tool when a task involves complex logic, requires precise numerical results, involves structured data processing, or follows a clear algorithmic procedure that is better expressed in code than natural language.
**Language Preference:**
Default to Python or JavaScript unless the user specifies a different language or the task inherently requires another (e.g., shell scripting).
**Parameters:**
- language: The programming language (e.g., 'python', 'javascript', 'bash').
- files: The files to include in the code execution.
- stdin: (Optional) Input data to be passed to the standard input of the code.
`,
parameters: RunRequestSchema,
},
];
export default tools;