Skip to main content
Glama

get_cosine_similarity

Calculate cosine similarity between two texts to measure their semantic similarity, returning a score from 0 (orthogonal) to 1 (identical) using bag-of-words vectors.

Instructions

Cosine similarity using bag-of-words vectors. 0=orthogonal, 1=identical.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
text1Yes
text2Yes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
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 burden of behavioral disclosure. It mentions the output interpretation (0 to 1 scale) but lacks critical details: it doesn't specify if the tool is read-only or has side effects, how it handles edge cases (e.g., empty strings), performance characteristics, or error conditions. The description is minimal and leaves behavioral traits largely undefined.

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?

The description is extremely concise and front-loaded, consisting of just two sentences that directly convey the core functionality and output range. Every word serves a purpose, with no redundant or verbose language, making it efficient and easy to parse.

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?

Given the tool's moderate complexity (a mathematical similarity measure with two parameters) and the presence of an output schema (which likely covers return values), the description is minimally adequate. However, with no annotations and low schema coverage, it lacks details on behavioral aspects and parameter semantics, leaving gaps in overall understanding despite the output schema's assistance.

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?

The input schema has two parameters (text1, text2) with 0% description coverage, meaning the schema provides no semantic information. The description adds some value by implying these are text inputs for similarity computation, but it doesn't elaborate on parameter constraints (e.g., text length, encoding) or usage examples. Given the low schema coverage, the description partially compensates but remains insufficient for full understanding.

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 clearly states the tool's purpose: 'Cosine similarity using bag-of-words vectors.' It specifies the mathematical operation (cosine similarity) and the representation method (bag-of-words vectors). However, it doesn't explicitly differentiate from sibling tools like 'get_jaccard_similarity' or 'get_edit_distance,' which are also similarity metrics for text.

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 provides no guidance on when to use this tool versus alternatives. It mentions the output range (0=orthogonal, 1=identical) but doesn't explain when cosine similarity is preferred over other similarity measures like Jaccard or edit distance, nor does it discuss prerequisites or context for usage.

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/BlackMount-ai/blackmount-nlp-mcp'

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