Skip to main content
Glama

reuse-before-generate

npm CI license reuse-before-generate MCP server

Your idea probably already exists. Find out before you build it, not after.

You ask an AI model about an idea, it tells you the space is wide open. You tell your agent to build it, and it churns out thousands of lines for something that already exists or nobody wants.

That happened to me. I kept hitting the same failing Android CI build and wished I could pause it, open a shell inside, fix the bug, and rerun. I asked THE Fable 5, it told me it was a brilliant idea, so I built fermata. A complete waste of time, tokens, and energy. Later I found out tools like action-tmate, actl, and actdbg already existed. AI models are just overenthusiastic and blind to what is out there.

The big picture

flowchart TD
    You["👤 You: Build me something"] --> AI["🤖 Your Hype-Man AI"]
    AI --> Tool["🔎 This MCP: Reuse_Before_Generate"]
    Tool --> Plan["Turn the idea into good search phrases"]
    Plan --> Shelves["Search several internet shelves"]
    Shelves --> Clean["Join copies and remove weak results"]
    Clean --> Boxes{"Put results into two boxes"}
    Boxes --> Reuse["🧩 Projects you may reuse"]
    Boxes --> Compete["🏪 Products you may compete with"]
    Reuse --> AIJudge["🤖 Your AI reads the evidence"]
    Compete --> AIJudge
    AIJudge --> Answer["👤 You get a short, useful answer"]

Sometimes your version really is different and you should keep going. Sometimes it saves you a weekend. Either way, you find out after ten seconds instead of 10,000 lines of code.

Related MCP server: idea-reality-mcp

Why bother?

Fewer wasted hours, fewer abandoned projects, and less energy burned generating duplicate code and hurting the environment. Jenna Pederson nailed it in You Can Build It, But Should You?, AI removed the friction that used to make us ask whether something is worth building at all.

For the record, this tool did not survive its own test either. But I had to build it to find out, and hopefully it keeps me from doing it again.


⚡ Quick Start & Installation

No API keys required to start. But Tavily API key is recommended, it is free to some extent and gives better competition coverage.

1. Claude Code CLI

To install it for all projects, run:

claude mcp add -s user reuse-before-generate -- npx -y reuse-before-generate
# To install it for current project only:
# claude mcp add reuse-before-generate -- npx -y reuse-before-generate

2. Cursor, Claude Desktop, Antigravity IDE, Windsurf, or VS Code

Add this snippet to your mcpServers configuration (e.g., ~/.claude/mcp.json, ~/.gemini/antigravity-ide/mcp_config.json, or Cursor's MCP settings):

{
  "mcpServers": {
    "reuse-before-generate": {
      "command": "npx",
      "args": ["-y", "reuse-before-generate@latest"]
    }
  }
}

For higher GitHub rate limits and broader web discovery, pass optional API keys in your environment:

{
  "mcpServers": {
    "reuse-before-generate": {
      "command": "npx",
      "args": ["-y", "reuse-before-generate@latest"],
      "env": {
        "GITHUB_TOKEN": "github_pat_your_token_here",
        "TAVILY_API_KEY": "tvly_your_key_here"
      }
    }
  }
}
  • GITHUB_TOKEN: Increases GitHub API search rate limit (from 10 to 30 req/min).

  • TAVILY_API_KEY: Enables web search to discover non-GitHub commercial products & SaaS tools.


🤖 Make It Automatic:

By default, your AI agent only checks when you explicitly ask. To force your agent to check automatically before building anything new, add this paragraph to your CLAUDE.md, .cursorrules, or AGENTS.md:

Before scaffolding a new project or building a substantial new module, call
`check_before_building` (or `reuse_before_generate`) from the `reuse-before-generate` MCP server first.
If it finds maintained open-source alternatives or competing products, present them and ask whether
to reuse/extend an existing project instead of building from scratch.

💡 How It Works (At a Glance)

  1. Multi-Shelf Search: Searches GitHub, GitLab, Show HN, package registries (npm, PyPI, crates.io, RubyGems, Maven), and Tavily web search.

  2. Dual-Box Evidence: Distinguishes between:

    • 🧩 Projects you could reuse (maintained open-source repositories)

    • 🏪 Products you would compete with (SaaS tools & commercial software)

  3. Zero Extra Cost: Doesn't make any separate LLM API calls. It returns raw, ranked evidence so your active AI session performs the semantic evaluation.


Known Limitations

  • Formulation Sensitivity: Keyword and formulation generation depends on the calling agent providing clear intent terms.

  • Small or Niche Repositories: GitHub search occasionally buries very new or low-star repositories (under 5 stars).

  • Maintenance Heuristic: Repositories active within the last year are considered active; deep contributor/issue health analysis is left to the calling agent.

  • Optional Web Key: Web product discovery relies on TAVILY_API_KEY. Without it, web search is reported as unavailable.


📖 Deep Dives & Documentation

For technical details, pipeline architecture, and local development:


License

MIT

Available Tools

2 tools
check_before_buildingA

Run this BEFORE scaffolding a new project or a substantial new module. Searches GitHub, npm, GitLab, Show HN, optional Tavily web search, Python repositories when relevant, and one ecosystem registry for Rust, Ruby, PHP, or JVM projects. Returns both reusable projects and products the proposal would compete with, plus complete retrieval evidence. The calling agent (you) remains responsible for semantic relevance judgment and must follow the returned scoring instructions. REQUIRES you to supply keywords yourself (see its field description) — do not guess this tool can extract good search terms on its own; generic terms like 'mcp'/'agent'/'server' will bury results in noise.

ParametersJSON Schema
NameRequiredDescriptionDefault
queriesNoOptional high-quality intent inferred semantically by the calling agent: category names what this is, outcome says what it accomplishes, synonyms supplies distinct terminology maintainers or product makers may use, constraints supplies up to 8 must-have properties, priorities supplies up to 4 ordered preferences, and artifactType says whether the desired result is an application, hosted service, CLI, or library. Older callers may omit these optional fields; the server will infer conservative fallbacks.
keywordsYesREQUIRED: 3-4 precise search terms YOU infer from the description, using your own understanding of what the user actually means — do this especially when the description is vague, informal, or from a non-native speaker. Pick the concrete domain noun a maintainer would actually put in their README, not a generic category word: e.g. for 'thing that checks my code doesn't have secret keys by mistake' prefer ["git", "secrets", "detect", "leak"] over ["secret", "scanner", "detect", "git"] — 'scanner' is broad enough to pull in unrelated security-tool listicles, while 'leak'/'secrets' matches how gitleaks/trufflehog actually describe themselves. Avoid generic tooling-ecosystem words (mcp, agent, server, tool, app) unless the description has nothing more specific — they return noise (awesome-lists, unrelated MCP servers) rather than real competitors. Critically, favor the word a maintainer would use to describe WHAT THE TOOL IS over the word describing the USER'S PROBLEM: a real 'pretty JSON in the terminal' tool likely calls itself a 'viewer' or 'processor', not a 'pretty-printer'/'colorizer'; a real static-site link checker likely says it validates 'rendered HTML', not 'static site alt-text'. If your first guess doesn't match, mentally simulate the README of the tool you're picturing and pull words straight from that sentence.
descriptionYesPlain-language description of the project/module about to be built — what it does, not how. The more specific, the better the match quality.

TDQS

A4.1/5.0
Behavior4/5

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

No annotations are provided, so the description fully conveys behavioral traits. It lists sources searched, types of results returned, and warns about generic keywords. It also clarifies agent responsibility for relevance judgment. This is detailed and honest.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long, especially the keywords advice, but it is front-loaded with the core purpose. Each sentence is informative, but some repetition and length could be trimmed without losing meaning. Adequately structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers the tool's purpose, search sources, result types, and agent responsibilities. However, it does not detail the return format (only mentions 'complete retrieval evidence'), and the tool is complex with a sibling tool that could have been contrasted more explicitly. Mostly complete but leaves some questions.

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 coverage is 100%, but the description adds significant value: for 'keywords', it gives extensive guidance on selecting effective terms with concrete examples. 'queries' is explained as optional and how to use it. 'description' is clarified as a plain-language requirement. This goes well beyond the schema.

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's purpose: 'Run this BEFORE scaffolding a new project or a substantial new module.' It specifies the sources searched and the outputs returned. The sibling tool 'reuse_before_generate' contrasts, making the distinct purpose clear.

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 explicitly says when to use the tool (before scaffolding) and provides detailed instructions on how to use it, including agent responsibilities and keyword selection. However, it does not explicitly state when not to use it or mention alternatives directly.

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

reuse_before_generateA

Run this BEFORE scaffolding a new project or a substantial new module. Searches GitHub, npm, GitLab, Show HN, optional Tavily web search, Python repositories when relevant, and one ecosystem registry for Rust, Ruby, PHP, or JVM projects. Returns both reusable projects and products the proposal would compete with, plus complete retrieval evidence. The calling agent (you) remains responsible for semantic relevance judgment and must follow the returned scoring instructions. REQUIRES you to supply keywords yourself (see its field description) — do not guess this tool can extract good search terms on its own; generic terms like 'mcp'/'agent'/'server' will bury results in noise.

ParametersJSON Schema
NameRequiredDescriptionDefault
queriesNoOptional high-quality intent inferred semantically by the calling agent: category names what this is, outcome says what it accomplishes, synonyms supplies distinct terminology maintainers or product makers may use, constraints supplies up to 8 must-have properties, priorities supplies up to 4 ordered preferences, and artifactType says whether the desired result is an application, hosted service, CLI, or library. Older callers may omit these optional fields; the server will infer conservative fallbacks.
keywordsYesREQUIRED: 3-4 precise search terms YOU infer from the description, using your own understanding of what the user actually means — do this especially when the description is vague, informal, or from a non-native speaker. Pick the concrete domain noun a maintainer would actually put in their README, not a generic category word: e.g. for 'thing that checks my code doesn't have secret keys by mistake' prefer ["git", "secrets", "detect", "leak"] over ["secret", "scanner", "detect", "git"] — 'scanner' is broad enough to pull in unrelated security-tool listicles, while 'leak'/'secrets' matches how gitleaks/trufflehog actually describe themselves. Avoid generic tooling-ecosystem words (mcp, agent, server, tool, app) unless the description has nothing more specific — they return noise (awesome-lists, unrelated MCP servers) rather than real competitors. Critically, favor the word a maintainer would use to describe WHAT THE TOOL IS over the word describing the USER'S PROBLEM: a real 'pretty JSON in the terminal' tool likely calls itself a 'viewer' or 'processor', not a 'pretty-printer'/'colorizer'; a real static-site link checker likely says it validates 'rendered HTML', not 'static site alt-text'. If your first guess doesn't match, mentally simulate the README of the tool you're picturing and pull words straight from that sentence.
descriptionYesPlain-language description of the project/module about to be built — what it does, not how. The more specific, the better the match quality.

TDQS

A4.9/5.0
Behavior5/5

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

Despite no annotations, the description thoroughly discloses the tool's behavior: it searches multiple platforms, returns both reusable projects and competing products along with retrieval evidence, and requires the agent to follow scoring instructions. It does not explicitly state read-only nature, but the description implies it is a search/retrieval tool with no side effects, which is sufficient for transparency.

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 well-structured with key information front-loaded. It is somewhat long but every sentence adds value, explaining the tool's function, sources, outputs, and usage responsibilities. Minor redundancy could be trimmed, but overall it is efficient for the complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 3 parameters (2 required), nested objects, and no output schema, the description is highly complete. It covers what the tool does, what sources it searches, what it returns, and the agent's responsibilities. The agent can confidently use this tool without ambiguity.

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

Parameters5/5

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

Schema coverage is 100%, but the description adds substantial meaning beyond the schema. The keywords parameter has a detailed explanation with examples of how to formulate precise terms and avoid noise. The queries object's fields are explained even though optional. This significantly aids correct parameter usage.

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's purpose: to be run before scaffolding a new project or module, and it searches multiple repositories for reuse. It distinguishes itself by listing the specific sources and the output including both reusable projects and competing products. The sibling 'check_before_building' implies different usage, so this tool's scope is well defined.

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?

The description explicitly says 'Run this BEFORE scaffolding a new project or a substantial new module.' It also provides guidance on when not to rely on the tool for keyword extraction, warning against generic terms. It sets expectations for the agent's responsibility in relevance judgment and following scoring instructions, making usage context very clear.

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

TDQS

A3.5/5.0
Disambiguation1/5

Both tools have nearly identical descriptions and appear to perform the same search across multiple sources. An agent cannot distinguish when to use one over the other.

Naming Consistency2/5

The names use different verbs ('check' vs 'reuse') and different noun forms ('building' vs 'generate'), with no consistent pattern. The naming is confusing and inconsistent.

Tool Count2/5

With only 2 tools that are essentially redundant, the number feels too low for the ambitious scope described (searching GitHub, npm, GitLab, Show HN, etc.). A single tool would suffice.

Completeness1/5

The server claims to handle search for reusable projects, but having two identical tools leaves no clear separation of concerns. Obvious gaps like dedicated filtering or fetching specific details are missing.

Maintenance

ActivitySlowing
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

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/aradar46/reuse-before-generate'

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