Skip to main content
Glama

midnight_analyze_contract

Analyze Compact smart contracts for security flaws, gas inefficiencies, and best practice violations to optimize contract design and reduce deployment risks.

Instructions

Perform static analysis on a Compact smart contract.

Analyzes:

  • Contract structure and patterns

  • Potential security issues

  • Gas/complexity estimates

  • Best practice violations

  • Privacy considerations

Use this tool to:

  • Review contracts before deployment

  • Identify potential issues

  • Learn Compact best practices

  • Optimize contract design

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceNoCompact contract source code to analyze
check_securityNo
check_gasNo
Behavior3/5

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

With no annotations, the description carries full burden. It describes the tool as performing static analysis, implying no side effects, but does not explicitly confirm read-only behavior or disclose any constraints, rate limits, or required permissions.

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 moderately sized with a clear structure: a one-line purpose, a bulleted list of analysis areas, and a bulleted list of use cases. It is front-loaded but could be slightly more concise by removing redundancy.

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 static analysis tool with no output schema and low parameter coverage, the description lacks details on output format, result interpretation, and how parameters control analysis. It feels incomplete for an agent to invoke effectively.

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

Parameters2/5

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

Schema description coverage is only 33% (only 'source' has a description). The description lists analysis categories but does not explain how parameters like 'check_security' or 'check_gas' affect analysis, missing an opportunity to compensate for the low coverage.

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 performs static analysis on Compact smart contracts, listing specific analysis areas (structure, security, gas, best practices, privacy) and use cases, which distinguishes it from sibling tools like compile or call.

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 provides explicit use cases (review before deployment, identify issues, learn best practices, optimize design), which guides when to use. While it does not explicitly state when not to use or alternatives, the sibling context makes it 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/DaJo-Code/midnight-nextjs-mcp'

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