Skip to main content
Glama

Extend AI Toolkit MCP Server

Official
chat_client.py1.49 kB
from abc import ABC, abstractmethod from typing import List, Dict, Any, Tuple, Optional class ChatClient(ABC): """ Abstract base class for LLM API clients. Implementations handle specific provider APIs (OpenAI, Anthropic, etc.) """ @abstractmethod async def generate_completion( self, messages: List[Dict[str, Any]], functions: List[Dict[str, Any]], max_tokens: int) -> Tuple[Optional[str], Optional[Dict]]: """ Generate a completion from the LLM. Args: messages: List of message dictionaries with role and content functions: List of function definitions max_tokens: Maximum tokens to generate Returns: Tuple containing: - content: The text response if no function call (None if function call) - function_call: Dictionary with name and arguments if a function call is needed, or None if no function call """ pass @abstractmethod async def generate_with_tool_result( self, messages: List[Dict[str, Any]], max_tokens: int) -> str: """ Generate a follow-up completion after a tool call. Args: messages: List of message dictionaries including tool results max_tokens: Maximum tokens to generate Returns: Text response from the model """ pass

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/paywithextend/extend-ai-toolkit'

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