Skip to main content
Glama
papyruslabs-ai

Seshat

Official

Find Semantic Clones

find_semantic_clones
Read-onlyIdempotent

Detect duplicated logic across files and languages by comparing normalized code structure. Use before DRY refactors to identify identical algorithms for consolidation.

Instructions

Find duplicated logic across the codebase. Normalizes variable names and compares code structure to catch identical algorithms in different files — even across different languages. Use this before a DRY refactor.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectNoProject name (required in multi-project mode). Use list_projects to see available projects.
min_complexityNoMinimum logic expressions to count as a match (default: 5)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.20.2

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false, so the safety profile is covered. The description adds valuable behavioral context: it normalizes variable names and compares structure across different languages, which is non-obvious detection behavior beyond what annotations convey.

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?

Two tight sentences: the first defines the capability, the second gives detection details and a usage directive. Front-loaded with the core purpose, zero waste.

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

Completeness4/5

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

For a read-only analysis tool with full param coverage and no output schema, the description covers purpose, detection method, and when to use. Return format is unspecified, but that's a minor gap given the low-risk read operation and sibling patterns.

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%, so the schema documents both parameters fully, including defaults and cross-tool reference ('Use list_projects'). The description does not add parameter syntax, but the baseline for full coverage is 3; the description's mention of cross-language comparison indirectly clarifies why min_complexity matters. Slightly above baseline.

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?

States a specific verb and resource ('Find duplicated logic'), and uniquely distinguishes itself from siblings like get_co_change_clusters or find_dead_code by explaining the semantic normalization approach. An agent can immediately tell what this does.

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?

Provides clear when-to-use context: 'Use this before a DRY refactor.' This gives a concrete scenario for invocation. It doesn't name alternatives or state when-not to use, but the pre-refactor timing is actionable guidance.

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