tools-call-simple-text passes when the tool does not exist
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 65/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- javascript, nodejs, typescript
Línea de trabajo
Look at the conformance test scenario 'tools-call-simple-text' in the test suite. The bug is that it incorrectly accepts an error response as a success. Examine the test logic that checks the result, likely in a file handling MCP tool call scenarios. Understand how the test validates 'isError' and the content text. Run the provided minimal server to reproduce the issue, then modify the test to fail when 'isError' is true or when the tool is not found.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
tools-call-simple-text reports SUCCESS against a server that has no test_simple_text tool. The server's "not found" error result is accepted as "returns simple text content".
Reproduced on 0.1.16 and 0.2.0-alpha.11.
Server: a minimal Streamable HTTP server on the official TypeScript SDK with one tool, get_forecast (full source below).
npx @modelcontextprotocol/conformance server --url http://127.0.0.1:3932/mcp --scenario tools-call-simple-text
# Passed: 1/1 (0.1.16), Passed: 2/2 (0.2.0-alpha.11)
checks.json records the evidence for the pass:
{"id":"tools-call-simple-text","status":"SUCCESS",
"details":{"result":{"content":[{"type":"text","text":"MCP error -32602: Tool test_simple_text not found"}],"isError":true}}}
Expected: FAILURE (or not-applicable) when the result has isError: true, and ideally a check that the text is the fixture's expected text. As it stands, any server that answers an unknown tool with an isError text result passes. That is every server built on the TypeScript SDK.
This looks like the same class of bug as #505, where a scenario accepts tool-error results in place of the success it is meant to verify. The other tools-call-* scenarios may be worth auditing for the same thing.
minimal.mjs
import express from "express";
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
import { z } from "zod";
function build() {
const s = new McpServer({ name: "weather", version: "1.0.0" });
s.tool("get_forecast", "Get the forecast for a city.", { city: z.string() },
{ readOnlyHint: true }, async ({ city }) => ({ content: [{ type: "text", text: `Sunny in ${city}` }] }));
return s;
}
const app = express();
app.use(express.json());
app.post("/mcp", async (req, res) => {
const server = build();
const transport = new StreamableHTTPServerTransport({ sessionIdGenerator: undefined });
res.on("close", () => { transport.close(); server.close(); });
await server.connect(transport);
await transport.handleRequest(req, res, req.body);
});
app.get("/mcp", (req, res) => res.status(405).end());
app.listen(Number(process.env.PORT), "127.0.0.1");
- Lenguaje dominante
- TypeScript
- Estrellas
- 127
- Forks
- 101
- Merge medio
- 4 d 7 h
- PR fusionados (30 d)
- 6
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de modelcontextprotocol/conformance
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
modelcontextprotocol/conformance#315 · 1 comentario ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
modelcontextprotocol/conformance#312 · 1 comentario ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 40/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
Todos los issues de modelcontextprotocol/conformance
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
vercel-labs/just-bash#464 ·
-
looksLikeSlug() is ASCII-only, so non-Latin entity slugs (e.g. Korean) skip exact match and collapse Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
TanStack/tanstack.com#1293 ·