Skip to main content
Glama

sjtu_text

Submit text prompts to SJTU's OpenAI-compatible API for completions. Configure model, temperature, and system prompt to tailor responses.

Instructions

Run a plain text task against the SJTU OpenAI-compatible API.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYes
modelNo
system_promptNo
temperatureNo
max_tokensNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler for the 'sjtu_text' MCP tool. It accepts a prompt, optional model/system_prompt/temperature/max_tokens, builds text messages via _build_text_messages, calls the SJTU chat API via client.chat, and extracts the response text via _extract_text.
    @mcp.tool()
    async def sjtu_text(
        prompt: str,
        model: str | None = None,
        system_prompt: str | None = None,
        temperature: float = 0.2,
        max_tokens: int | None = None,
    ) -> str:
        """Run a plain text task against the SJTU OpenAI-compatible API."""
        response = await client.chat(
            model=model or settings.default_text_model,
            messages=_build_text_messages(prompt, system_prompt),
            temperature=temperature,
            max_tokens=max_tokens,
        )
        return _extract_text(response)
  • The tool is registered with the MCP framework via the @mcp.tool() decorator on line 62 (for sjtu_models) and line 68 (for sjtu_text). The 'FastMCP' instance named 'mcp' is created on line 12 and the decorator registers the function as an MCP tool.
    @mcp.tool()
  • Helper function _extract_text parses the API response dict to extract the text content from the first choice's message. Handles both plain string and list-of-content-blocks formats.
    def _extract_text(response: dict[str, Any]) -> str:
        choices = response.get("choices", [])
        if not choices:
            return "No choices returned."
        message = choices[0].get("message", {})
        content = message.get("content", "")
        if isinstance(content, str):
            return content
        if isinstance(content, list):
            chunks: list[str] = []
            for item in content:
                if isinstance(item, dict) and item.get("type") == "text":
                    chunks.append(str(item.get("text", "")))
            return "\n".join(chunk for chunk in chunks if chunk)
        return str(content)
  • Helper function _build_text_messages constructs the messages list for a plain text chat completion request, optionally including a system prompt.
    def _build_text_messages(prompt: str, system_prompt: str | None) -> list[dict[str, Any]]:
        messages: list[dict[str, Any]] = []
        if system_prompt:
            messages.append({"role": "system", "content": system_prompt})
        messages.append({"role": "user", "content": prompt})
        return messages
  • The schema for sjtu_text is defined implicitly through the function signature parameters: prompt (str, required), model (str | None), system_prompt (str | None), temperature (float, default 0.2), max_tokens (int | None). The return type is str.
        prompt: str,
        model: str | None = None,
        system_prompt: str | None = None,
        temperature: float = 0.2,
        max_tokens: int | None = None,
    ) -> str:
        """Run a plain text task against the SJTU OpenAI-compatible API."""
        response = await client.chat(
Behavior2/5

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

No annotations provided, and the description does not disclose behavioral traits such as idempotency, side effects, rate limits, or cost. The tool's safety profile (read vs. write) is unclear.

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

Conciseness2/5

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

The description is a single sentence but lacks necessary detail. It is under-specified rather than appropriately concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 5 parameters, no annotations, and an output schema not described, the description fails to provide a complete picture. The tool's return value and parameter usage are left unspecified.

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

Parameters1/5

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

Schema description coverage is 0%, and the description adds no meaning beyond the parameter names. It does not explain the role of model, system_prompt, temperature, or max_tokens.

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 states the verb 'run' and resource 'plain text task' against a specific API. It distinguishes from vision tasks but does not clarify what 'plain text task' entails compared to the sibling sjtu_cheap_task.

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 on when to use this tool versus alternatives like sjtu_cheap_task or sjtu_vision. No context on cost, speed, or prerequisites.

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/EternalWavee/sjtu-mcp'

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