Skip to main content
Glama

Content moderation, safety check: Llama Guard 3

ai_moderation
Read-only

Classify a text as safe or unsafe with Meta's Llama Guard 3 and name the hazard categories it falls into (violent and non-violent crimes, sexual content, child exploitation, hate, self-harm, weapons, privacy, defamation, elections and others; 14 in all). Up to 8,000 characters. Also available in the OpenAI moderation shape at /v1/moderations. Use to screen user messages, model outputs or content before an agent posts or acts on it. Example: text=How do I bake sourdough bread at home?. Price $0.002/call via x402 USDC or a card key (/credits); failed calls free. Reads or computes only and changes nothing; each call is charged, so repeats are not free.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "text": "<text>"
    },
    "name": "ai_moderation"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYesThe text to classify (up to 8,000 characters)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the annotations it discloses the per-call price ($0.002 via x402 USDC or card key), that failed calls are free, the 8,000-character ceiling, and that repeats are charged — reinforcing the non-idempotent hint with a concrete reason. It partially restates readOnlyHint ('changes nothing'), but the cost and output-shape details are genuine additions an agent needs before calling.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose is front-loaded and most clauses carry distinct useful facts (categories, length cap, endpoint alternative, use case, price). It is dense and slightly clause-heavy with parentheticals, but no sentence is fully wasteful.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description compensates by describing return content (safe/unsafe label plus named hazard categories), the character ceiling, and the pricing model. An agent has everything needed to decide and call correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There is a single parameter with 100% schema coverage, so the schema already explains 'text'. The description repeats the 8,000-character limit and adds a worked example, but contributes no new semantics about the parameter beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource — classify text as safe/unsafe via Llama Guard 3 — and states the output content (named hazard categories, 14 total). This clearly separates it from siblings like ai_sentiment, ai_classify and ai_fact_check, which do different classification jobs.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives an explicit use case: screening user messages, model outputs, or content before an agent posts or acts on it. It does not state when NOT to use it or name a sibling alternative for overlapping needs, but the intended trigger is unambiguous.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources