Skip to main content
Glama
kamelirzouni

Qwen Max MCP Server

by kamelirzouni

qwen_max

Generate text content using the Qwen Max language model with configurable parameters for tailored responses.

Instructions

Generate text using Qwen Max model

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYesThe text prompt to generate content from
max_tokensNoMaximum number of tokens to generate
temperatureNoSampling temperature (0-2)

Implementation Reference

  • MCP CallToolRequestSchema handler that validates tool name 'qwen_max', extracts arguments, calls Qwen Max model using OpenAI client, and returns the generated text.
        async (request) => {
            if (request.params.name !== "qwen_max") {
                throw new McpError(
                    ErrorCode.MethodNotFound,
                    `Unknown tool: ${request.params.name}`
                );
            }
    
            const { prompt, max_tokens = 8192, temperature = 0.7 } = 
                request.params.arguments as QwenMaxArgs;
    
            try {
                const completion = await this.openai.chat.completions.create({
                    model: "qwen-max-latest",
                    messages: [{ role: "user", content: prompt }],
                    max_tokens,
                    temperature
                });
    
                return {
                    content: [{
                        type: "text",
                        text: completion.choices[0].message.content || ""
                    }]
                };
            } catch (error: any) {
                console.error("Qwen API Error:", error);
                throw new McpError(
                    ErrorCode.InternalError,
                    `Qwen API error: ${error.message}`
                );
            }
        }
    );
  • JSON schema for qwen_max tool inputs, defining prompt (required), max_tokens, and temperature parameters.
    inputSchema: {
        type: "object",
        properties: {
            prompt: {
                type: "string",
                description: "The text prompt to generate content from"
            },
            max_tokens: {
                type: "number",
                description: "Maximum number of tokens to generate",
                default: 8192
            },
            temperature: {
                type: "number",
                description: "Sampling temperature (0-2)",
                default: 0.7,
                minimum: 0,
                maximum: 2
            }
        },
        required: ["prompt"]
    }
  • TypeScript interface defining the arguments for the qwen_max tool handler.
    interface QwenMaxArgs {
        prompt: string;
        max_tokens?: number;
        temperature?: number;
    }
  • src/index.ts:59-89 (registration)
    MCP ListToolsRequestSchema handler that registers the qwen_max tool with its description and input schema.
    this.server.setRequestHandler(
        ListToolsRequestSchema,
        async () => ({
            tools: [{
                name: "qwen_max",
                description: "Generate text using Qwen Max model",
                inputSchema: {
                    type: "object",
                    properties: {
                        prompt: {
                            type: "string",
                            description: "The text prompt to generate content from"
                        },
                        max_tokens: {
                            type: "number",
                            description: "Maximum number of tokens to generate",
                            default: 8192
                        },
                        temperature: {
                            type: "number",
                            description: "Sampling temperature (0-2)",
                            default: 0.7,
                            minimum: 0,
                            maximum: 2
                        }
                    },
                    required: ["prompt"]
                }
            }]
        })
    );
  • src/index.ts:33-36 (registration)
    Initialization of the MCP Server instance named 'qwen_max' with tool capabilities.
    this.server = new Server(
        { name: "qwen_max", version: "1.0.0" },
        { capabilities: { tools: {} } }
    );
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. While 'Generate text' implies a read-only operation, it doesn't disclose important behavioral traits like rate limits, authentication requirements, response format, error conditions, or cost implications. For a text generation tool with zero annotation coverage, this leaves significant gaps in understanding how the tool behaves.

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 extremely concise at just 5 words. Every word earns its place by specifying the action ('Generate'), resource ('text'), and model ('Qwen Max model'). There's no wasted language, repetition, or unnecessary elaboration. The structure is front-loaded with the core function.

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 this is a text generation tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what the tool returns, error conditions, rate limits, or any behavioral characteristics. While the schema covers parameters well, the overall context for using this tool effectively is incomplete. A text generation tool needs more contextual information than provided.

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

Parameters3/5

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

Schema description coverage is 100%, so all parameters are documented in the schema. The description adds no parameter-specific information beyond what the schema already provides. It doesn't explain relationships between parameters, provide examples, or add semantic context. The baseline score of 3 reflects adequate parameter documentation coming entirely from the schema.

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 tool's purpose as 'Generate text using Qwen Max model' - a specific verb ('Generate') with resource ('text') and model specification. It distinguishes itself as a text generation tool, though with no sibling tools, differentiation isn't needed. The purpose is unambiguous but could be slightly more specific about the type of text generation.

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?

The description provides no guidance on when to use this tool versus alternatives. With no sibling tools mentioned, there's no context about other available models or tools. It doesn't mention prerequisites, limitations, or ideal use cases. The agent receives only the basic function without usage context.

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/kamelirzouni/MCP-server-Qwen_Max'

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