Skip to main content
Glama

scan_data

Detect sensitive information in text including PII, API keys, passwords, and financial data to enhance data security and compliance.

Instructions

Scan text for sensitive data: PII (Chinese ID cards, phone numbers, bank cards), API keys, passwords, private keys, JWT tokens, SSN, credit cards.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesText to scan for sensitive data

Implementation Reference

  • The handler function 'scanData' performs sensitivity analysis on input text and logs any findings using the 'redactSensitive' helper and the internal 'AuditLog' class.
    scanData(text: string, toolName?: string): ScanResult {
      const [, findings] = redactSensitive(text)
      const hasSensitiveData = findings.length > 0
      const summary = findings.map(f => `${f.name}(${f.count})`).join(', ')
    
      if (hasSensitiveData) {
        for (const f of findings) {
          this.log.write({
            level: 'HIGH',
            layer: 'L2',
            action: 'audit',
            detail: this.locale === 'zh'
              ? `检测到敏感数据: ${f.name}: ${f.count} 处 — 已记录审计日志,数据正常返回`
              : `Sensitive data detected: ${f.name}: ${f.count} occurrence(s) — audited, data passed through`,
            tool: toolName,
            pattern: f.id,
          })
        }
        this.markSensitiveData(toolName || 'unknown', summary)
      }
    
      return { hasSensitiveData, findings, summary }
    }

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/jnMetaCode/shellward'

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