Skip to main content
Glama

Deskaid

by ezyang
ClientSession.pyi1.52 kB
"""Type stubs for the mcp.ClientSession class. This module provides type definitions for the mcp.ClientSession class. """ from typing import ( Any, Dict, List, TypeVar, Union, ) T = TypeVar("T") class CallToolResult: """Result of calling a tool via MCP.""" isError: bool content: Union[str, List["TextContent"], Any] class TextContent: """A class representing text content.""" text: str def __init__(self, text: str) -> None: """Initialize a new TextContent instance. Args: text: The text content """ ... class ClientSession: """A session for interacting with an MCP server.""" def __init__(self, read: Any, write: Any) -> None: """Initialize a new ClientSession. Args: read: A callable that reads from the server write: A callable that writes to the server """ ... async def initialize(self) -> None: """Initialize the session.""" ... async def call_tool(self, name: str, arguments: Dict[str, Any]) -> CallToolResult: """Call a tool on the MCP server. Args: name: The name of the tool to call arguments: Dictionary of arguments to pass to the tool Returns: An object with isError and content attributes """ ... async def __aenter__(self) -> "ClientSession": ... async def __aexit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None: ...

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/ezyang/codemcp'

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