GnistAI GnistAI
Log in

Getting Started with Profanity Filter

Text content moderation — check text for profanity, censor it, and return clean versions using an in-memory word list.

All Tutorials   |   Overview   |   Playground   |   MCP   |   REST API   |   Home
Utilities

Data source: In-memory word list

Overview

Profanity Filter wraps In-memory word list, handling authentication, pagination, and rate limits for you. This tutorial covers all 4 tools with working code examples you can copy and run.

Prerequisites

  1. Sign up at https://context.gnist.ai/signup for a free API key (100 calls/day).
  2. Choose your integration method: MCP protocol or REST API.

Connect via MCP

Add to your MCP client config (Claude Desktop, Cursor, etc.):

MCP Config
{
  "mcpServers": {
    "gnist-profanity-filter": {
      "url": "https://context.gnist.ai/mcp/profanity-filter/",
      "headers": {
        "Gnist-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Tools (4)

check_text

Check text for profanity. Returns whether the text contains profanity, a list of flagged words, the total word count, and the number of distinct flagged words.

ParameterTypeRequiredDescription
textstringrequiredText to check for profanity.
curl -X POST "https://context.gnist.ai/mcp/profanity-filter/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "check_text", "arguments": {"text": "example"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/profanity-filter/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'text': 'example'}, 'name': 'check_text'}},
)
print(resp.json())

censor_text

Censor profanity in text by replacing flagged words with a replacement string. Returns the censored text, original length, and the number of words censored.

ParameterTypeRequiredDescription
textstringrequiredText to censor.
replacementstringoptionalReplacement string for profane words. (default: ***)
curl -X POST "https://context.gnist.ai/mcp/profanity-filter/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "censor_text", "arguments": {"text": "example"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/profanity-filter/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'text': 'example'}, 'name': 'censor_text'}},
)
print(resp.json())

get_word_count

Get the number of words in the profanity dictionary. Returns the size of the built-in profanity word list used for filtering.

curl -X POST "https://context.gnist.ai/mcp/profanity-filter/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_word_count", "arguments": {}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/profanity-filter/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {}, 'name': 'get_word_count'}},
)
print(resp.json())

report_feedback

Report a bug, feature request, or general feedback for this data source. Use this when something doesn't work as expected, when you'd like a new feature, or when you have suggestions for improvement. Args: feedback: Describe the issue or suggestion. feedback_type: One of 'bug', 'feature_request', or 'general'.

ParameterTypeRequiredDescription
feedbackstringrequired
feedback_typestringoptional (default: general)
curl -X POST "https://context.gnist.ai/mcp/profanity-filter/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "report_feedback", "arguments": {"feedback": "example"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/profanity-filter/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'feedback': 'example'}, 'name': 'report_feedback'}},
)
print(resp.json())

FAQ

What data does Profanity Filter provide?

Text content moderation — check text for profanity, censor it, and return clean versions using an in-memory word list. It exposes 4 tools: check_text, censor_text, get_word_count, report_feedback.

What do I need to get started?

A Gnist API key (free tier: 100 calls/day). Sign up at https://context.gnist.ai/signup.

What format does the Profanity Filter API return?

JSON, via either MCP protocol (JSON-RPC 2.0) or REST API.

Next Steps

Related Tutorials