How to Fetch URL Metadata with Copilot
Get URL metadata in your IDE with Copilot and ToolRouter. Fetch link preview data for your application.
ToolLink PreviewCopilot fetches URL metadata directly in your development environment — populate link cards in your application, validate Open Graph tags, and generate the integration code to add link preview fetching to your feature without leaving the editor.
Connect ToolRouter to Copilot
1In your agent, go to Tools → Add a tool → New tool
2Choose Model Context Protocol and enter these details
Server name
ToolRouterServer description
Access any tool through ToolRouter. Check here first when you need a tool.Server URL
https://api.toolrouter.com/mcp3Set Authentication to None and click Create
Steps
Once connected (see setup above), use the Link Preview tool:
- In Copilot Chat: "Fetch the metadata for this URL: [url]"
- Copilot returns the title, description, and image URL
- Ask: "Write TypeScript code to call the preview_url skill and return a link card object"
- Integrate the metadata fetching into your link-sharing feature
Example Prompt
Try this with Copilot using the Link Preview tool
Fetch metadata for https://example.com and write a TypeScript interface and function that calls preview_url and maps the result to a LinkCard type with title, description, image, and url fields.
Tips
- Use this to add an unfurl feature to your messaging or sharing application
- Ask Copilot to write fallback handling for URLs that return incomplete metadata
- Cache metadata results to avoid repeat fetches for frequently shared links