Skip to main content
Glama

test_generate_mocks

Create mock objects, stubs, and test fixtures from source code to isolate dependencies in tests. Specify framework and dependencies to generate ready-to-use test doubles.

Instructions

Generate mock objects, stubs, and test fixtures for dependencies (Pro)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
api_keyNoAPI key for authentication
frameworkNoTest/mock framework to use
source_codeYesSource code with dependencies to mock
dependenciesNoList of dependencies to create mocks for
Behavior2/5

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

No annotations are provided, so the description carries the full behavioral burden, but it only states the generation action. It does not disclose whether files are written to disk, whether the api_key is required for this '(Pro)' feature, or what the tool returns, leaving side effects and access requirements opaque.

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?

A single 11-word sentence with the core action front-loaded; the '(Pro)' marker is compact and informative. Every word earns its place, though the brevity is achieved by omitting behavioral details that are scored elsewhere.

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?

With no output schema and no annotations, the description needed to clarify return behavior, Pro/authentication requirements, and parameter interdependencies, but it does not. Key facts an agent needs — whether generated mocks are returned inline or written to disk, and whether api_key is effectively mandatory despite being optional in the schema — are absent.

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 the baseline of 3 applies — each parameter (api_key, framework, source_code, dependencies) already has a meaningful schema description. The tool description adds no relationship or format details (e.g., how dependencies and source_code interact, what framework values are accepted).

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 names a specific verb ('Generate') and a concrete resource ('mock objects, stubs, and test fixtures for dependencies'), so the tool's function is clear at a glance. It is reasonably distinguishable from siblings like test_generate_unit and test_generate_edge_cases by its focus on test doubles for dependencies, though it never explicitly names an alternative to differentiate itself.

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 contains no guidance on when to choose this tool over related siblings such as api_create_mock or clitest_add_mocks. There are no conditions, prerequisites, or exclusions — the agent must infer usage entirely from the tool name and the one-line purpose.

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/barnburner121/claude-plugin-marketplace'

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