Skip to main content
Glama

Schwab Model Context Protocol Server

by jkoelker
_registration.py1.28 kB
from __future__ import annotations from collections.abc import Awaitable, Callable from typing import Any from mcp.server.fastmcp import FastMCP from mcp.types import ToolAnnotations ToolFn = Callable[..., Awaitable[Any]] def register_tool( server: FastMCP, func: ToolFn, *, write: bool = False, annotations: ToolAnnotations | None = None, ) -> None: """Register a Schwab tool using FastMCP's decorator plumbing.""" tool_annotations = annotations if tool_annotations is None: if write: tool_annotations = ToolAnnotations( readOnlyHint=False, destructiveHint=True, ) else: tool_annotations = ToolAnnotations( readOnlyHint=True, ) else: update: dict[str, Any] = {} if tool_annotations.readOnlyHint is None: update["readOnlyHint"] = not write if write and tool_annotations.destructiveHint is None: update["destructiveHint"] = True if update: tool_annotations = tool_annotations.model_copy(update=update) server.tool( name=func.__name__, description=func.__doc__, annotations=tool_annotations, )(func) __all__ = ["register_tool"]

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/jkoelker/schwab-mcp'

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