Skip to main content
Glama

HuggingFace — Text Summarization

hf_inference.nlp.summarize
Read-onlyIdempotent

Summarize a long text into a shorter, coherent paragraph using the facebook/bart-large-cnn model via HuggingFace Inference API. Trained on CNN/DailyMail news articles; works well for factual prose. Control output length with max_length (token cap) and min_length (token floor) parameters. A custom model can be supplied (e.g. google/pegasus-xsum for extreme single-sentence summaries). Useful for article digests, executive summaries, and reducing LLM context window usage.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesInput text to process. Maximum ~10,000 characters depending on model context window.
modelNoHuggingFace model ID to use for summarization. Default: "facebook/bart-large-cnn" (trained on CNN/DailyMail, excellent for news and articles). Alternatives: "sshleifer/distilbart-cnn-12-6" (faster, lighter), "google/pegasus-xsum" (extreme summarization, single sentence).
max_lengthNoMaximum number of tokens in the generated summary (20–1024). Default: model-controlled (typically ~150 tokens for BART-large-CNN). Set lower for shorter summaries (e.g. 60 for a single-sentence abstract).
min_lengthNoMinimum number of tokens in the generated summary (10–512). Prevents very short or empty summaries. Default: model-controlled (typically ~30 tokens). Set min_length lower than max_length.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNoPresent only when the call failed. Includes error code, message, request_id, and any provider-specific extras.
resultNoTool response payload. Shape varies per tool — consult the tool description and inputSchema. May be an object, array, string, or number depending on the upstream provider response.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, and non-destructive, so the safety profile is covered. The description adds genuinely useful behavior beyond that: the model is trained on CNN/DailyMail factual prose, input is capped around 10,000 characters, and output length is controlled by token floor/cap parameters. It omits any mention of inference latency, rate limits, or API cost.

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?

Five sentences, but each carries distinct information: operation/model, domain fit, length controls, model override, and use cases. The core operation is front-loaded. It is slightly longer than strictly needed and could compress the model-override and use-case sentences.

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

Completeness4/5

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

An output schema exists, so return values need no explanation, and annotations cover the safety profile. The description supplies model choice, input limits, and length tuning, which is sufficient for correct invocation. Minor gaps remain around operational concerns like rate limits or cost, but nothing an agent needs to call it correctly is missing.

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?

Schema description coverage is 100%, so the schema already documents text, model, max_length, and min_length in detail. The description largely restates the schema's token cap/floor semantics and the model alternatives; it adds only the framing that max_length is a 'cap' and min_length a 'floor,' which is already implied. Baseline 3 is appropriate.

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?

States a specific verb (summarize) and resource (long text into a shorter paragraph), names the default model, and the task is inherently distinct from the sibling NLP tools (ner, sentiment, translate, zero_shot). An agent can identify the operation and its scope without opening the schema.

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?

Gives concrete use contexts (article digests, executive summaries, reducing context window) and steers model selection for a specific scenario (pegasus-xsum for single-sentence output). It stops short of explicit when-not-to-use conditions or direct comparison against the sibling inference tools, so it is clear context rather than full routing guidance.

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.