Skip to main content
Glama

list_strategies

Browse available chunking strategies for your RAG corpus. Filter by content type to find relevant options.

Instructions

List registered chunking strategies, optionally filtered by content type.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
content_typeNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler registered via @mcp.tool() decorator. Calls list_strategies_impl and logs call latency.
    @mcp.tool()
    def list_strategies(content_type: str | None = None) -> list[dict]:
        """List registered chunking strategies, optionally filtered by content type."""
        t0 = time.perf_counter()
        try:
            out = list_strategies_impl(content_type)
            _log_tool("list_strategies", t0, True)
            return out
        except Exception:
            _log_tool("list_strategies", t0, False)
            raise
  • FastAPI HTTP route handler for GET /list_strategies, delegates to list_strategies_impl.
    @router.get("/list_strategies")
    def list_strategies(content_type: str | None = None) -> list[dict]:
        return list_strategies_impl(content_type)
  • Shared implementation that builds the full strategy registry and returns a list of strategy dicts (name, description, supported_content_types, supported_params).
    def list_strategies_impl(content_type: str | None = None) -> list[dict]:
        reg = build_full_registry()
        out: list[dict] = []
        for s in reg.list(content_type):
            out.append(
                {
                    "name": s.name,
                    "description": s.description,
                    "supported_content_types": s.supported_content_types,
                    "supported_params": s.param_schema(),
                }
            )
        return out
  • Tool registered via @mcp.tool() decorator inside register_tools(), making it available as an MCP tool.
    @mcp.tool()
    def list_strategies(content_type: str | None = None) -> list[dict]:
        """List registered chunking strategies, optionally filtered by content type."""
        t0 = time.perf_counter()
        try:
            out = list_strategies_impl(content_type)
            _log_tool("list_strategies", t0, True)
            return out
        except Exception:
            _log_tool("list_strategies", t0, False)
            raise
  • StrategyRegistry class with list() method that optionally filters by content_type, used internally by list_strategies_impl.
    class StrategyRegistry:
        def __init__(self) -> None:
            self._by_name: dict[str, ChunkingStrategy] = {}
    
        def register(self, strategy: ChunkingStrategy) -> None:
            self._by_name[strategy.name] = strategy
    
        def get(self, name: str) -> ChunkingStrategy:
            if name not in self._by_name:
                raise KeyError(f"Unknown strategy: {name}")
            return self._by_name[name]
    
        def list(self, content_type: str | None = None) -> list[ChunkingStrategy]:
            strategies = list(self._by_name.values())
            if content_type is None:
                return strategies
            return [s for s in strategies if content_type in s.supported_content_types]
    
        def names(self, content_type: str | None = None) -> list[str]:
            return [s.name for s in self.list(content_type)]
Behavior2/5

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

With no annotations, the description should disclose behavioral traits. It only states a list operation but omits details like pagination, ordering, or whether the list is exhaustive. The optional filter is mentioned but no further behavior is described.

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

Conciseness5/5

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

The description is a single, efficient sentence that front-loads the verb and resource. No redundant information.

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

Completeness3/5

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

Given the presence of an output schema, the description need not detail return values. However, it lacks behavioral context (e.g., pagination) and does not leverage the schema to compensate for missing aspects.

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?

The description adds meaning to the 'content_type' parameter by mentioning it filters results. However, schema coverage is 0% and the description does not explain valid values or format, leaving ambiguity.

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 clearly states the tool lists registered chunking strategies, with an optional filter by content type. It distinguishes from siblings like evaluate_chunking or preview_chunks by focusing on listing rather than evaluation or preview.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives like evaluate_chunking or preview_chunks. The description does not mention use cases, prerequisites, or limitations.

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

Install Server

Other Tools

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/shantanu-deshmukh/chunktuner'

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