Skip to main content
Glama
SecretiveShell

MCP-wolfram-alpha

query-wolfram-alpha

Answer complex mathematical questions and perform symbolic computations using computational intelligence. Submit queries to solve problems requiring advanced calculation or analysis.

Instructions

Use Wolfram Alpha to answer a question. This tool should be used when you need complex math or symbolic intelligence.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes

Implementation Reference

  • Executes the 'query-wolfram-alpha' tool: calls the Wolfram client with the query, processes the response pods and subpods to extract plaintext and images (downloading and base64 encoding images), and returns a list of TextContent or ImageContent.
    if name == "query-wolfram-alpha":
        results: list[types.TextContent | types.ImageContent | types.EmbeddedResource] = []
        query = arguments.get("query")
        if not query:
            raise ValueError("Missing 'query' parameter for Wolfram Alpha tool")
    
        try:
            response = await client.aquery(query)
        except Exception as e:
            raise Exception("Failed to query Wolfram Alpha") from e
        
        try:
            async with httpx.AsyncClient() as http_client:
                for pod in response.pods:
                    for subpod in pod.subpods:
    
                        if subpod.plaintext:  # Handle text content
                            results.append(types.TextContent(
                                type="text",
                                text=subpod.plaintext
                            ))
                            
                        elif subpod.img:  # Handle image content
                            img_url = subpod.img.get("src")
                            if img_url:
                                img_response = await http_client.get(img_url)
                                if img_response.status_code == 200:
                                    img_base64 = base64.b64encode(img_response.content).decode('utf-8')
                                    results.append(types.ImageContent(
                                        type="image",
                                        data=img_base64,
                                        mimeType="image/png"
                                    ))
        except Exception as e:
            raise Exception("Failed to parse response from Wolfram Alpha") from e
    
        return results
  • Registers the 'query-wolfram-alpha' tool in the list_tools() method, specifying its name, description, and input JSON schema.
        types.Tool(
            name="query-wolfram-alpha",
            description="Use Wolfram Alpha to answer a question. This tool should be used when you need complex math or symbolic intelligence.",
            inputSchema={
                "type": "object",
                "properties": {
                    "query": {"type": "string"}  # Correct property: `query` with type `string`
                },
                "required": ["query"]  # Marking `query` as required
            },
        )
    ]
  • JSON schema for tool input: requires a single 'query' property of type string.
    inputSchema={
        "type": "object",
        "properties": {
            "query": {"type": "string"}  # Correct property: `query` with type `string`
        },
        "required": ["query"]  # Marking `query` as required
    },
  • Imports the WolframAlpha client used by the tool handler to perform the actual API query.
    from .wolfram_client import client
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 mentions the tool's purpose but doesn't disclose important behavioral traits such as rate limits, authentication requirements, response format, or error handling. It adds minimal value beyond stating what the tool does.

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 appropriately sized and front-loaded with the core purpose in the first sentence and usage guidance in the second. Both sentences earn their place by providing essential information without waste.

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 tool's complexity (querying an external API for complex computations), lack of annotations, no output schema, and low parameter coverage, the description is incomplete. It doesn't address how results are returned, error conditions, or practical constraints, leaving significant gaps for an AI agent.

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?

The input schema has 1 parameter with 0% description coverage. The description doesn't add any meaning about the 'query' parameter beyond what's implied by the tool's purpose. It doesn't explain what constitutes a valid query, format expectations, or examples, failing to compensate for the low schema coverage.

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: 'Use Wolfram Alpha to answer a question.' It specifies the action ('answer a question') and the resource (Wolfram Alpha). However, it doesn't distinguish from siblings since there are none, so it can't achieve a perfect 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context on when to use this tool: 'when you need complex math or symbolic intelligence.' This gives explicit guidance on appropriate use cases. However, it doesn't mention when NOT to use it or name alternatives, so it falls short of a 5.

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/SecretiveShell/MCP-wolfram-alpha'

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