Skip to main content
Glama
snilld-ai

OpenAI Assistant MCP Server

by snilld-ai

ask-openai

Ask direct questions to OpenAI's GPT models through the MCP server, receiving AI-generated answers for information, analysis, or problem-solving tasks.

Instructions

Ask my assistant models a direct question

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesAsk assistant
modelNogpt-4.1
temperatureNo
max_tokensNo

Implementation Reference

  • Core implementation of the 'ask-openai' tool: calls OpenAI's chat.completions.create API with system prompt and user query.
    async def ask_openai(self, query: str, model: str = "gpt-4", temperature: float = 0.7, max_tokens: int = 500) -> str:
        try:
            response = await self.client.chat.completions.create(
                messages=[
                    {"role": "system", "content": "You are a helpful assistant."},
                    {"role": "user", "content": query}
                ],
                model=model,
                temperature=temperature,
                max_tokens=max_tokens
            )
            return response.choices[0].message.content
        except Exception as e:
            logger.error(f"Failed to query OpenAI: {str(e)}")
            raise
  • Dispatch logic in the @server.call_tool() handler that invokes LLMConnector.ask_openai with arguments from the tool call.
    if name == "ask-openai":
        response = await connector.ask_openai(
            query=arguments["query"],
            model=arguments.get("model", "gpt-4"),
            temperature=arguments.get("temperature", 0.7),
            max_tokens=arguments.get("max_tokens", 500)
        )
        return [types.TextContent(type="text", text=f"OpenAI Response:\\n{response}")]
  • Registration of the 'ask-openai' tool in the @server.list_tools() handler, defining name, description, and input schema.
    types.Tool(
        name="ask-openai",
        description="Ask my assistant models a direct question",
        inputSchema={
            "type": "object",
            "properties": {
                "query": {"type": "string", "description": "Ask assistant"},
                "model": {"type": "string", "default": "gpt-4.1", "enum": ["gpt-4.1", "gpt-4.1-mini", "gpt-4o", "gpt-4o-mini", "o3", "o3-mini", "o3-deep-research"]},
                "temperature": {"type": "number", "default": 0.1, "minimum": 0, "maximum": 1},
                "max_tokens": {"type": "integer", "default": 500, "minimum": 1, "maximum": 40000}
            },
            "required": ["query"]
        }
    ),
  • Input schema definition for the 'ask-openai' tool, specifying parameters like query (required), model, temperature, and max_tokens.
    inputSchema={
        "type": "object",
        "properties": {
            "query": {"type": "string", "description": "Ask assistant"},
            "model": {"type": "string", "default": "gpt-4.1", "enum": ["gpt-4.1", "gpt-4.1-mini", "gpt-4o", "gpt-4o-mini", "o3", "o3-mini", "o3-deep-research"]},
            "temperature": {"type": "number", "default": 0.1, "minimum": 0, "maximum": 1},
            "max_tokens": {"type": "integer", "default": 500, "minimum": 1, "maximum": 40000}
        },
        "required": ["query"]
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. The description only states 'Ask my assistant models a direct question', which implies a read-like interaction but doesn't disclose any behavioral traits such as whether this is a read-only operation, if it requires authentication, rate limits, response format, or potential side effects. For a tool with no annotations, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise with a single sentence, 'Ask my assistant models a direct question', which is front-loaded and wastes no words. However, it's overly brief to the point of under-specification, lacking necessary details for clarity. It earns a high score for conciseness but loses a point because the brevity compromises usefulness.

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 tool with 4 parameters, no annotations, no output schema, and low schema coverage, the description is incomplete. It doesn't provide enough context for an AI agent to understand what the tool does, how to use it effectively, or what to expect in return. The lack of behavioral and parameter details makes it inadequate for informed tool selection and invocation.

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 low at 25%, with only the 'query' parameter having a description ('Ask assistant'). The description text does not add any meaning beyond the schema: it doesn't explain what 'model' refers to, what 'temperature' or 'max_tokens' control, or how parameters interact. With 4 parameters and minimal schema coverage, the description fails to compensate, leaving most parameters semantically unclear.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Ask my assistant models a direct question' states a vague purpose: it indicates asking something to models but lacks specificity about what 'assistant models' are or what domain this operates in. It doesn't distinguish from siblings like 'create-assistant' or 'retrieve-assistant', which are clearly different operations. The verb 'ask' is generic, and 'direct question' is ambiguous without context.

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. The description doesn't mention any prerequisites, context, or exclusions. Given siblings like 'create-assistant' or 'list-assistants', there's no indication of how this tool relates to them or when it's appropriate to ask a question versus performing other assistant-related operations.

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/snilld-ai/openai-assistant-mcp'

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