Skip to main content
Glama

Classify an image for safety

cloudcdn_ai_moderate
Read-onlyIdempotent

Classify an image for unsafe content before publishing and get a safe verdict plus category scores for nudity, violence, drugs, hate symbols, and gore.

Instructions

Classify one image for unsafe content before publishing it. To describe an image instead use cloudcdn_ai_alt; to find images use cloudcdn_assets or cloudcdn_search. Calls GET /api/ai/moderate and returns its JSON: url (the path sent), safe (true only when verdict is "safe"), verdict ("safe", "borderline" or "unsafe"), categories (a score from 0 to 1 for each of nudity, violence, drugs, hateSymbols and gore), reasoning (one sentence from the model), model, source ("ai" or "cached"), degraded (true for a cached answer) and dateGenerated (ISO 8601). When the model's answer cannot be parsed, verdict is "borderline" with every score 0. Deciding what to block is left to the caller; nothing is removed, and the API caches the verdict per path for 24 hours. Fails: an absolute http(s) URL, or a path containing "..", is rejected (HTTP 400, exit code 69); an image the API cannot fetch, HTTP 404 (exit code 69); the vision model unavailable, HTTP 503 (exit code 75 after retries); no valid key, HTTP 401 (exit code 77).

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": {
      "url": "<url>"
    },
    "name": "cloudcdn_ai_moderate"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesThe image's path on the CDN, not an absolute URL: the path field from cloudcdn_assets or cloudcdn_search with a leading slash, e.g. "/acme/v1/hero.webp".

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.0.24
    • addedInput schema / properties / url / description
      Added value: +"The image's path on the CDN, not an absolute URL: the path field from cloudcdn_assets or cloudcdn_search with a leading slash, e.g. \"/acme/v1/hero.webp\"."
  2. First observedv0.0.23

TDQS

A4.6/5.0
Behavior4/5

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

Beyond the readOnly/openWorld/idempotent annotations, the description discloses caching for 24 hours, the degraded/cached flag, the borderline fallback when parsing fails, and a full failure matrix with HTTP status and exit codes. The only gap is that it does not state whether the cache can be bypassed or what the cost/latency profile of a fresh model call is.

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?

It is front-loaded with purpose and alternatives before the mechanical detail, and the return-field enumeration is justified because no output schema exists. It is dense as a single paragraph, and the error-code list could be bulleted, but little is redundant.

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 carries the full return-value burden and does so field by field, including the meaning of safe versus verdict and the degraded flag. Failure modes, caching behavior, and the caller's responsibility for blocking decisions are all covered, which is everything needed to call and interpret this one-parameter tool.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds consequences the schema does not: an absolute http(s) URL or a path containing ".." is rejected with HTTP 400 and exit code 69. It also clarifies that the returned url is the path as sent, reinforcing the leading-slash path convention.

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 opening sentence names a specific verb and resource (classify one image for unsafe content) and adds the intended moment of use (before publishing). It immediately contrasts with cloudcdn_ai_alt for description and cloudcdn_assets/cloudcdn_search for discovery, so the agent can pick the right tool without opening a schema.

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

Usage Guidelines5/5

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

Explicit routing is given for both adjacent tasks: use cloudcdn_ai_alt to describe an image, and cloudcdn_assets or cloudcdn_search to find images. It also states the decision boundary that matters most here — the tool only classifies, and blocking policy is left to the caller.

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