Skip to main content
Glama

url_shorten

Shorten URLs to create compact links for sharing and tracking. This tool from IteraTools MCP converts long web addresses into manageable short links.

Instructions

Shorten a URL ($0.001)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes

Implementation Reference

  • index.js:50-79 (handler)
    The generic `callTool` function that handles API requests for all tools, including `url_shorten`.
    async function callTool(endpoint, params) {
      const fetch = (await import('node-fetch')).default;
      const isGet = ['GET'].includes((TOOLS.find(t => t.endpoint === endpoint) || {}).method);
      
      const url = isGet 
        ? `${BASE_URL}${endpoint}?${new URLSearchParams(params)}`
        : `${BASE_URL}${endpoint}`;
      
      const res = await fetch(url, {
        method: isGet ? 'GET' : 'POST',
        headers: {
          'Content-Type': 'application/json',
          'Authorization': `Bearer ${API_KEY}`,
        },
        body: isGet ? undefined : JSON.stringify(params),
      });
      
      const text = await res.text();
      let data;
      try { data = JSON.parse(text); } catch { data = { raw: text }; }
      
      if (!res.ok) {
        if (res.status === 402) {
          throw new Error(`Insufficient credits. Add credits at https://iteratools.com. Cost: ${TOOLS.find(t=>t.endpoint===endpoint)?.price || 'see docs'}`);
        }
        throw new Error(`API error ${res.status}: ${text.substring(0, 200)}`);
      }
      
      return data;
    }
  • index.js:37-37 (registration)
    Registration of the `url_shorten` tool within the `TOOLS` array.
    { name: 'url_shorten', description: 'Shorten a URL', inputSchema: { type: 'object', properties: { url: { type: 'string' } }, required: ['url'] }, endpoint: '/url/shorten', price: '$0.001' },
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It successfully reveals pricing information ($0.001) which is valuable context, but fails to mention mutation characteristics, idempotency, rate limits, or what the tool returns (the shortened URL string).

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?

Extremely concise at five words. Every element earns its place: the action ('Shorten'), the resource ('a URL'), and critical cost context ('$0.001'). No filler or redundant text.

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 low-complexity single-parameter tool, the description covers the core operation and cost, but leaves gaps given the lack of output schema. It omits what the tool returns (the short URL), error scenarios (invalid URLs), and whether shortened URLs expire.

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

Parameters2/5

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

Schema description coverage is 0%, requiring the description to compensate. While the single parameter 'url' is self-evident from the tool name and description context, the text does not explicitly document the parameter's purpose, expected format (absolute vs relative), or validation constraints.

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 uses a specific verb ('Shorten') with a clear resource ('URL'), making the tool's function immediately obvious. Among the diverse sibling tools (audio_transcribe, image_generate, etc.), this distinctly identifies the URL shortening capability.

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, nor does it mention prerequisites (e.g., URL format requirements) or when not to use it. The cost hint ($0.001) implies it's a paid operation but doesn't explain cost implications.

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/fredpsantos33/itera-tools-mcp'

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