Skip to main content
Glama
nickweedon

Skeleton MCP Server

by nickweedon

list_items

Retrieve and filter items with pagination support to manage large datasets efficiently. Use optional name filters to find specific items quickly.

Instructions

List all items with optional filtering and pagination.

Args: page: Page number (1-indexed) page_size: Number of items per page filter_name: Optional filter by name (case-insensitive contains)

Returns: A dictionary containing: - items: List of item objects - total: Total number of items matching the filter - page: Current page number - page_size: Number of items per page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNo
page_sizeNo
filter_nameNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function implementing the list_items tool logic, supporting pagination, filtering, and returning structured item data using mock data.
    async def list_items(
        page: int = 1,
        page_size: int = 10,
        filter_name: str | None = None,
    ) -> dict[str, Any]:
        """
        List all items with optional filtering and pagination.
    
        Args:
            page: Page number (1-indexed)
            page_size: Number of items per page
            filter_name: Optional filter by name (case-insensitive contains)
    
        Returns:
            A dictionary containing:
            - items: List of item objects
            - total: Total number of items matching the filter
            - page: Current page number
            - page_size: Number of items per page
        """
        # In a real implementation:
        # client = get_client()
        # return client.get("items", params={"page": page, "page_size": page_size})
    
        items = list(MOCK_ITEMS.values())
    
        if filter_name:
            items = [i for i in items if filter_name.lower() in i["name"].lower()]
    
        total = len(items)
        start = (page - 1) * page_size
        end = start + page_size
        items = items[start:end]
    
        return {
            "items": items,
            "total": total,
            "page": page,
            "page_size": page_size,
        }
  • The registration of the list_items tool by applying the mcp.tool() decorator to example.list_items.
    mcp.tool()(example.list_items)
  • Mock data structure used by the list_items handler to simulate item storage.
    MOCK_ITEMS: dict[str, dict[str, Any]] = {
        "item-1": {
            "id": "item-1",
            "name": "Example Item 1",
            "description": "This is a sample item",
            "created_at": "2024-01-01T00:00:00Z",
            "updated_at": "2024-01-01T00:00:00Z",
        },
        "item-2": {
            "id": "item-2",
            "name": "Example Item 2",
            "description": "Another sample item",
            "created_at": "2024-01-02T00:00:00Z",
            "updated_at": "2024-01-02T00:00:00Z",
        },
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses pagination behavior and optional filtering, which is helpful. However, it doesn't mention important behavioral aspects like whether this is a read-only operation (implied but not stated), rate limits, authentication requirements, or error conditions.

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?

The description is well-structured with a clear purpose statement followed by Args and Returns sections. It's appropriately sized with no wasted words, though the formatting with separate sections could be slightly more concise if integrated into flowing text.

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?

Given the tool's moderate complexity (3 parameters, pagination, filtering), the description is reasonably complete. The presence of an output schema means the description doesn't need to explain return values in detail, and it provides good parameter semantics. However, it lacks context about when to use this versus sibling tools.

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?

The schema description coverage is 0%, so the description must compensate. It provides clear semantics for all three parameters: page (1-indexed), page_size (items per page), and filter_name (case-insensitive contains). This adds significant value beyond the bare schema, though it doesn't explain default values or constraints like minimum/maximum values.

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

Purpose4/5

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

The description clearly states the tool's purpose as 'List all items with optional filtering and pagination', which is a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'get_item' which might retrieve a single item, though the 'list all items' phrasing implies a collection operation.

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?

The description provides no guidance on when to use this tool versus alternatives like 'get_item' for single items or how it relates to other siblings like 'create_item', 'update_item', and 'delete_item'. There's no mention of prerequisites, context, or exclusion criteria.

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/nickweedon/mcp_server_template'

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