Skip to main content
Glama

url_get_after_redirects

Resolve the final URL after all redirects using the ReviewWebsite API. Input a URL to retrieve its destination, ensuring accurate web content analysis and verification.

Instructions

Get URL after redirects using ReviewWeb.site API.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
api_keyNoYour ReviewWebsite API key
urlYesURL to get after redirects

Implementation Reference

  • MCP tool handler function that receives tool arguments, calls the controller to resolve the URL after redirects, formats the MCP response, and handles errors.
    async function handleGetUrlAfterRedirects(
    	args: UrlGetUrlAfterRedirectsToolArgsType,
    ) {
    	const methodLogger = Logger.forContext(
    		'tools/reviewwebsite.tool.ts',
    		'handleGetUrlAfterRedirects',
    	);
    	methodLogger.debug(`Getting URL after redirects:`, {
    		...args,
    		api_key: args.api_key ? '[REDACTED]' : undefined,
    	});
    
    	try {
    		const result = await reviewWebsiteController.getUrlAfterRedirects(
    			args.url,
    			{
    				api_key: args.api_key,
    			},
    		);
    
    		return {
    			content: [
    				{
    					type: 'text' as const,
    					text: result.content,
    				},
    			],
    		};
    	} catch (error) {
    		methodLogger.error(`Error getting URL after redirects`, error);
    		return formatErrorForMcpTool(error);
    	}
    }
  • Registration of the MCP tool 'url_get_after_redirects' with the server, including name, description, input schema shape, and handler reference.
    server.tool(
    	'url_get_after_redirects',
    	`Get URL after redirects using ReviewWeb.site API.`,
    	UrlGetUrlAfterRedirectsToolArgs.shape,
    	handleGetUrlAfterRedirects,
    );
  • Zod schema defining the tool's input parameters: required 'url' string and optional 'api_key' string.
    export const UrlGetUrlAfterRedirectsToolArgs = z.object({
    	url: z.string().describe('URL to get after redirects'),
    	api_key: z.string().optional().describe('Your ReviewWebsite API key'),
    });
  • Core service function that makes the HTTP GET request to the ReviewWebsite API endpoint to retrieve the final URL after following redirects.
    async function getUrlAfterRedirects(
    	url: string,
    	apiKey?: string,
    ): Promise<any> {
    	const methodLogger = Logger.forContext(
    		'services/vendor.reviewwebsite.service.ts',
    		'getUrlAfterRedirects',
    	);
    
    	try {
    		methodLogger.debug('Getting URL after redirects', { url });
    
    		// Build query parameters
    		const params = new URLSearchParams();
    		params.append('url', url);
    
    		const response = await axios.get(
    			`${API_BASE}/url/get-url-after-redirects`,
    			{
    				params,
    				headers: getHeaders(apiKey),
    			},
    		);
    
    		methodLogger.debug('Successfully got URL after redirects');
    		return response.data;
    	} catch (error) {
    		return handleApiError(error, 'getUrlAfterRedirects');
    	}
    }
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 gets a URL after redirects but lacks details on rate limits, authentication needs (implied by 'api_key' parameter), error handling, or what 'after redirects' entails (e.g., final destination, redirect chain). This is inadequate for a tool with API interaction.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose. It avoids unnecessary words, though it could be slightly more informative without losing conciseness.

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 complexity of an API-based tool with no annotations and no output schema, the description is incomplete. It doesn't explain the return value (e.g., final URL, response data), error cases, or behavioral traits, leaving significant gaps for the agent.

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 description coverage is 100%, so the schema already documents both parameters ('api_key' and 'url') adequately. The description adds no additional meaning beyond implying the API key is for ReviewWebsite, which is redundant with the schema. Baseline 3 is appropriate as the schema does the heavy lifting.

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 action ('Get URL after redirects') and specifies the method ('using ReviewWeb.site API'), which distinguishes it from generic URL fetching tools. However, it doesn't explicitly differentiate from sibling tools like 'scrape_url' or 'url_is_alive', which might have overlapping functionality.

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 like 'scrape_url' or 'url_is_alive'. It mentions the API but doesn't explain specific use cases, prerequisites, or exclusions, leaving the agent to infer context.

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/mrgoonie/reviewwebsite-mcp-server'

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