Skip to main content
Glama
seanshin0214

Dr. QuantMaster MCP Server

by seanshin0214

optimize_code

Optimize code for large datasets by analyzing R, Stata, or Python scripts and suggesting performance improvements based on data size specifications.

Instructions

대용량 데이터용 코드 최적화 제안

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes최적화할 코드
data_sizeNo데이터 크기 (행 수, GB)
languageYes언어

Implementation Reference

  • Registration of the 'optimize_code' tool in the exported tools array, including name, description, and input schema definition.
      name: "optimize_code",
      description: "대용량 데이터용 코드 최적화 제안",
      inputSchema: {
        type: "object",
        properties: {
          code: { type: "string", description: "최적화할 코드" },
          data_size: { type: "string", description: "데이터 크기 (행 수, GB)" },
          language: { type: "string", enum: ["r", "stata", "python"], description: "언어" },
        },
        required: ["code", "language"],
      },
    },
  • The implementation of the 'optimize_code' tool handler. It returns language-specific recommendations for optimizing code for large datasets, ignoring the provided code snippet.
    function handleOptimizeCode(args: Record<string, unknown>) {
      return {
        language: args.language,
        data_size: args.data_size,
        recommendations: {
          r: ["Use data.table instead of data.frame", "Use fst for file I/O", "Consider collapse package"],
          stata: ["Use gtools (gisid, gegen)", "Use ftools (reghdfe)", "Compress data"],
          python: ["Use pandas with chunking", "Consider dask or polars", "Use parquet format"]
        }
      };
    }
  • The switch case in the main handleToolCall function that routes calls to the 'optimize_code' handler.
    case "optimize_code":
      return handleOptimizeCode(args);
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions 'suggestions' which implies advisory/non-destructive output, but doesn't clarify if it modifies code, requires specific inputs beyond parameters, has rate limits, or what the output format looks like. For a tool with no annotation coverage, this leaves significant behavioral gaps.

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?

The description is a single, efficient sentence in Korean that directly states the tool's purpose. It's front-loaded with no wasted words, making it easy to parse despite language differences. Every part of the sentence contributes meaning.

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?

Given no annotations and no output schema, the description is incomplete for a tool with 3 parameters. It doesn't explain what kind of suggestions are provided, how they're formatted, or any behavioral constraints. For a code optimization tool in a research/statistics context (per siblings), more context about output expectations is needed.

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 parameters are well-documented in the schema itself. The description adds no additional parameter semantics beyond implying optimization is for 'large-scale data' (hinting at data_size relevance). With high schema coverage, baseline 3 is appropriate as the description doesn't compensate but doesn't need to heavily.

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

Purpose4/5

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

The description clearly states the tool's purpose as 'code optimization suggestions for large-scale data' (verb+resource+scope). It distinguishes from siblings like debug_code (fixing errors) or code_template (creating templates) by focusing on performance optimization. However, it doesn't explicitly differentiate from all possible optimization-related siblings, keeping it at 4 rather than 5.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. With many sibling tools (e.g., debug_code, generate_python_code, suggest_method), there's no indication of when optimization is preferred over other code-related actions. The description only states what it does, not when it's appropriate.

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/seanshin0214/quantmaster-mcp-server'

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