Skip to main content
Glama
clsung

Taiwan Stock Agent

by clsung

list_resources

Discover available Taiwan stock market data resources, including templates and examples, to access real-time prices, historical data, and company information.

Instructions

List all available MCP resources with templates and examples

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'list_resources' tool. It uses resource_manager to fetch resource templates, cache statistics, and active subscriptions, returning them in a structured dictionary with metadata. Handles exceptions gracefully.
    @mcp.tool(name="list_resources",
              description="List all available MCP resources with templates and examples")
    async def list_resources_tool() -> Dict[str, Any]:
        """List all available MCP resources."""
        try:
            templates = resource_manager.list_resource_templates()
            cache_stats = resource_manager.get_cache_stats()
            subscriptions = resource_manager.get_subscriptions()
            
            return {
                "resource_templates": templates,
                "cache_statistics": cache_stats,
                "active_subscriptions": subscriptions,
                "total_resources": len(templates),
                "_metadata": {
                    "source": "tw-stock-agent",
                    "timestamp": datetime.now().isoformat(),
                    "data_type": "resource_discovery"
                }
            }
        except Exception as e:
            logger.error(f"Failed to list resources: {e}")
            return {
                "error": f"Failed to list resources: {str(e)}",
                "_metadata": {
                    "source": "tw-stock-agent",
                    "timestamp": datetime.now().isoformat(),
                    "data_type": "resource_discovery",
                    "has_error": True
                }
            }
  • mcp_server.py:243-244 (registration)
    The @mcp.tool decorator registers the list_resources_tool function as an MCP tool named 'list_resources' with a description.
    @mcp.tool(name="list_resources",
              description="List all available MCP resources with templates and examples")
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool lists resources but doesn't describe how it behaves—e.g., whether it's read-only, if it requires authentication, rate limits, pagination, or what the output format looks like. For a tool with zero annotation coverage, this leaves significant gaps in understanding its operational traits.

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 directly states the tool's purpose without unnecessary words. It's front-loaded with the core action and resource, making it easy to scan and understand quickly. Every part of the sentence contributes value by specifying scope ('all available MCP resources') and additional details ('with templates and examples').

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 tool's simplicity (0 parameters, no output schema, no annotations), the description is adequate but has clear gaps. It explains what the tool does but lacks behavioral context and usage guidelines. For a basic listing tool, it meets the minimum viable standard but doesn't provide enough information for optimal agent use without additional inference.

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 input schema has 0 parameters with 100% coverage, so the schema fully documents that no inputs are required. The description adds no parameter information, which is appropriate here. Since there are no parameters, the baseline score is 4, as the description doesn't need to compensate for any gaps.

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 verb ('List') and resource ('all available MCP resources'), specifying what the tool does. It adds detail about including 'templates and examples', which helps differentiate it from generic listing tools. However, it doesn't explicitly distinguish from sibling tools like 'get_stock_data' or 'get_market_overview', which appear to be more specific resource-fetching operations.

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. It doesn't mention prerequisites, context for usage, or comparisons to sibling tools like 'get_stock_data' or 'subscribe_resource'. Users must infer usage from the purpose alone, which is insufficient for effective tool selection.

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/clsung/tw-stock-agent'

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