Skip to main content
Glama
by pangeacyber
redact.ts1.31 kB
import type { FastMCP } from 'fastmcp'; import { PangeaConfig, RedactService } from 'pangea-node-sdk'; import { z } from 'zod'; import { aiGuard } from '../guard.js'; import type { FastMCPSessionAuth, ServerContext } from '../types.js'; export function registerRedactTools< T extends FastMCPSessionAuth = FastMCPSessionAuth, >({ server, context }: { server: FastMCP<T>; context: ServerContext }) { const redactParameters = z.object({ text: z.string().describe('The text data to redact'), }); server.addTool({ name: 'redact', description: 'Redact sensitive information from provided text.', parameters: redactParameters, execute: aiGuard<T, typeof redactParameters>(context, async ({ text }) => { const redact = new RedactService( context.apiToken, new PangeaConfig({ domain: 'aws.us.pangea.cloud' }) ); const response = await redact.redact(text); if (!response.success) { return { content: [ { type: 'text', text: 'Failed to retrieve reputation data', }, ], }; } return { content: [ { type: 'text', text: JSON.stringify(response.result, null, 2), }, ], }; }), }); }

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