Skip to main content
Glama
by pangeacyber
url-intel.ts1.73 kB
import type { FastMCP } from 'fastmcp'; import { PangeaConfig, URLIntelService } from 'pangea-node-sdk'; import { z } from 'zod'; import type { FastMCPSessionAuth, ServerContext } from '../types.js'; export function registerUrlIntelTools< T extends FastMCPSessionAuth = FastMCPSessionAuth, >({ server, context }: { server: FastMCP<T>; context: ServerContext }) { server.addTool({ name: 'lookup_url_reputation', description: 'Look up reputation score(s) for one or more URLs.', parameters: z.object({ urls: z .array(z.string().url()) .min(1) .max(100) .describe('The URLs to be looked up'), }), // Not running AI Guard for this tool because the recipes will block // malicious URLs, which are exactly the sort of inputs and outputs that // this tool wants to be dealing with. execute: async ({ urls }) => { const urlIntel = new URLIntelService( context.apiToken, new PangeaConfig({ domain: 'aws.us.pangea.cloud' }) ); const response = await urlIntel.reputationBulk(urls); if (!response.success) { return { content: [ { type: 'text', text: 'Failed to retrieve reputation data', }, ], }; } const formattedReputation = Object.entries(response.result.data).map( ([url, reputation]) => `${url}: ${reputation.verdict} (score ${reputation.score}) (categories ${reputation.category.join(', ')})` ); return { content: [ { type: 'text', text: `Reputation data:\n\n${formattedReputation.join('\n')}`, }, ], }; }, }); }

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/pangeacyber/pangea-mcp-server'

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