Skip to main content
Glama

cosinesim_compare

Read-onlyIdempotent

Calculate cosine similarity between two texts using word frequency vectors. Compare text pairs to measure semantic overlap or duplication.

Instructions

Calculate cosine similarity between two texts using word frequency vectors.

Input Schema

NameRequiredDescriptionDefault
text_aYesFirst text.
text_bYesSecond text.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.11

TDQS

B3.3/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent, non-destructive, and openWorld, so the safety profile is covered. The phrase 'using word frequency vectors' usefully discloses the underlying algorithm (bag-of-words, no semantics/stemming), which affects interpretation of results, but the description omits the output range (0-1), behavior on empty or identical texts, and case/tokenization handling.

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?

A single front-loaded sentence with zero padding. Every clause ('cosine similarity', 'two texts', 'word frequency vectors') carries information.

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?

For a simple two-parameter read-only computation with full annotation coverage, the essentials are present. However, with no output schema, the description should say what the returned value looks like (numeric range, edge cases), which it omits.

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 coverage is 100%, though the schema's own descriptions are minimal ('First text.', 'Second text.'). The description adds nothing about what form the texts should take or how length/language affects the vectors, so this sits at the baseline where the schema does the work.

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?

A specific verb ('calculate') plus a specific metric ('cosine similarity') and scope ('between two texts'). The metric name alone separates it from siblings like jaccard_similarity, hamming_distance, and edit_distance, but the description never names or contrasts those alternatives explicitly.

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?

No guidance on when to choose cosine similarity over the many other similarity/distance tools in the sibling list, and no conditions or exclusions stated. The agent must infer selection criteria from the metric name alone.

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

Deploy Server

Other Tools