Skip to main content
Glama
kesslerio

YOURLS-MCP

by kesslerio

update_url

Modify an existing short URL to redirect to a new destination. Use this tool to update the target URL and optionally change the title for your shortened link, ensuring accurate redirection.

Instructions

Update an existing short URL to point to a different destination URL

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
shorturlYesThe short URL or keyword to update
titleNoOptional new title for the URL
urlYesThe new destination URL

Implementation Reference

  • The execute function implementing the core logic of the 'update_url' MCP tool. It calls yourlsClient.updateUrl with fallback, handles success/fallback responses, and formats MCP responses.
    execute: async ({ shorturl, url, title }) => {
      try {
        // Use the updateUrl method with fallback enabled
        const result = await yourlsClient.updateUrl(shorturl, url, title, true);
        
        // Check for both plugin success message and fallback success messages
        if (result.status === 'success' || result.message === 'success: updated') {
          const responseData = {
            shorturl: result.shorturl || shorturl,
            url: url,
            message: result.message || 'Short URL updated successfully'
          };
          
          // Add fallback information if applicable
          if (result.fallback_used) {
            responseData.fallback_used = true;
            if (result.fallback_limited) {
              responseData.fallback_limited = true;
            }
            if (result.fallback_limitations) {
              responseData.fallback_limitations = result.fallback_limitations;
            }
          }
          
          return createMcpResponse(true, responseData);
        } else {
          throw new Error(result.message || 'Unknown error');
        }
      } catch (error) {
        return createMcpResponse(false, {
          message: error.message,
          shorturl: shorturl,
          url: url
        });
      }
    }
  • JSON Schema definition for the input parameters of the 'update_url' tool.
    inputSchema: {
      type: 'object',
      properties: {
        shorturl: {
          type: 'string',
          description: 'The short URL or keyword to update'
        },
        url: {
          type: 'string',
          description: 'The new destination URL'
        },
        title: {
          type: 'string',
          description: 'Optional new title ("keep" to keep existing, "auto" to fetch from URL)'
        }
      },
      required: ['shorturl', 'url']
    },
  • src/index.js:188-197 (registration)
    Primary registration of the 'update_url' tool with the MCP server in the main entry point, using Zod schema derived from the tool definition.
    server.tool(
      updateUrlTool.name,
      updateUrlTool.description,
      {
        shorturl: z.string().describe('The short URL or keyword to update'),
        url: z.string().describe('The new destination URL'),
        title: z.string().optional().describe('Optional new title for the URL')
      },
      updateUrlTool.execute
    );
  • Alternative registration of the 'update_url' tool in the tools aggregation module.
    server.tool(
      updateUrlTool.name,
      updateUrlTool.description,
      {
        shorturl: z.string().describe('The short URL or keyword to update'),
        url: z.string().describe('The new destination URL'),
        title: z.string().optional().describe('Optional new title for the URL')
      },
      updateUrlTool.execute
    );
Behavior2/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 states the tool updates a short URL but does not mention permissions required, whether changes are reversible, rate limits, or error handling. This leaves significant gaps for a mutation tool.

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 a single, efficient sentence that front-loads the core action ('update an existing short URL') and specifies the purpose ('to point to a different destination URL'). There is no wasted text, making it highly concise and well-structured.

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

Completeness2/5

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

Given the tool is a mutation with no annotations and no output schema, the description is incomplete. It does not cover behavioral aspects like side effects, return values, or error conditions, which are critical for safe and effective use in this context.

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 schema description coverage is 100%, so the schema already documents all parameters. The description adds no additional meaning beyond implying the 'url' parameter is the new destination, which is already clear from the schema. This meets the baseline for high schema coverage.

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 verb 'update' and the resource 'existing short URL', specifying the action of changing its destination. It distinguishes from siblings like 'create_custom_url' (creation) and 'delete_url' (deletion), making the purpose specific and unambiguous.

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, such as 'change_keyword' (which might update keywords) or 'contract_url' (which could modify URLs differently). It lacks context on prerequisites or exclusions, offering only a basic functional statement.

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

Related 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/kesslerio/yourls-mcp'

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