Skip to main content
Glama
clsung

Taiwan Stock Agent

by clsung

subscribe_resource

Subscribe to Taiwan stock market resource updates for real-time data caching and notification alerts on specific stocks or market information.

Instructions

Subscribe to resource updates for caching and notifications

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
resource_uriYes

Implementation Reference

  • The handler function for the 'subscribe_resource' MCP tool. It subscribes to the specified resource URI using resource_manager and returns the subscription status along with active subscriptions and metadata.
    @mcp.tool(name="subscribe_resource",
              description="Subscribe to resource updates for caching and notifications")
    async def subscribe_resource_tool(resource_uri: str) -> Dict[str, Any]:
        """Subscribe to resource updates."""
        try:
            success = resource_manager.subscribe_to_resource(resource_uri)
            return {
                "resource_uri": resource_uri,
                "subscribed": success,
                "active_subscriptions": resource_manager.get_subscriptions(),
                "_metadata": {
                    "source": "tw-stock-agent",
                    "timestamp": datetime.now().isoformat(),
                    "data_type": "resource_subscription"
                }
            }
        except Exception as e:
            logger.error(f"Failed to subscribe to resource {resource_uri}: {e}")
            return {
                "resource_uri": resource_uri,
                "subscribed": False,
                "error": str(e),
                "_metadata": {
                    "source": "tw-stock-agent",
                    "timestamp": datetime.now().isoformat(),
                    "data_type": "resource_subscription",
                    "has_error": True
                }
            }
Behavior2/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It mentions 'caching and notifications' but lacks details on permissions, rate limits, side effects, or response format. This is inadequate for a subscription tool that likely involves ongoing processes or network operations.

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 with no wasted words. It's front-loaded with the core action and purpose, making it easy to parse quickly.

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

Completeness2/5

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

Given the complexity of a subscription tool (likely involving state changes or network calls), no annotations, no output schema, and poor parameter coverage, the description is incomplete. It doesn't address what happens after subscription, error conditions, or how it integrates with caching/notifications.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate. It doesn't explain the 'resource_uri' parameter beyond what the schema provides (just a string). No details on format, examples, or how it relates to 'resource updates' are given, leaving the parameter's meaning unclear.

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 action ('Subscribe') and purpose ('to resource updates for caching and notifications'), making the tool's function understandable. It doesn't differentiate from siblings like 'invalidate_cache' or 'list_resources', but it's not vague or tautological.

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 is provided on when to use this tool versus alternatives like 'invalidate_cache' or 'list_resources'. The description implies usage for caching and notifications but doesn't specify contexts, prerequisites, or exclusions, leaving the agent to infer when it's appropriate.

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