返回 CodeWhale
tools_resources_prompts.case.json
根目录 / crates / tui / tests / fixtures / conformance / mcp / tools_resources_prompts.case.json
1 {
2 "description": "A full-capability server: catalog normalization (name prefixing, sorting, meta-tools for resources/templates/prompts), a plain result, an isError result, a JSON-RPC error, progress before the result, an image block, cancellation of a call the server never answers followed by a working call, resources and prompts through the meta-tools, and an unadvertised tool that must never reach the server.",
3 "server_name": "conformance",
4 "server": {
5 "initialize": {
6 "result": {
7 "protocolVersion": "2025-06-18",
8 "serverInfo": {
9 "name": "conformance-server",
10 "version": "1.0.0"
11 },
12 "capabilities": {
13 "tools": {},
14 "resources": {},
15 "prompts": {}
16 },
17 "instructions": "Conformance fixture server. Tools are deterministic."
18 }
19 },
20 "tools/list": {
21 "result": {
22 "tools": [
23 {
24 "name": "z_last",
25 "description": "Listed first by the server; the catalog sorts by name.",
26 "inputSchema": {
27 "type": "object",
28 "properties": {}
29 }
30 },
31 {
32 "name": "echo",
33 "description": "Echo the text argument.\nSecond description line.",
34 "inputSchema": {
35 "type": "object",
36 "properties": {
37 "text": {
38 "type": "string"
39 }
40 },
41 "required": [
42 "text"
43 ]
44 },
45 "annotations": {
46 "readOnlyHint": true
47 }
48 },
49 {
50 "name": "fails",
51 "description": "Always reports a tool-level error.",
52 "inputSchema": {
53 "type": "object"
54 }
55 },
56 {
57 "name": "rpc-error",
58 "inputSchema": {
59 "type": "object"
60 }
61 },
62 {
63 "name": "slow",
64 "description": "Sends progress notifications before its result.",
65 "inputSchema": {
66 "type": "object"
67 }
68 },
69 {
70 "name": "hangs",
71 "description": "Never answers until the caller goes away.",
72 "inputSchema": {
73 "type": "object"
74 }
75 },
76 {
77 "name": "image",
78 "description": "Returns text and an image block.",
79 "inputSchema": {
80 "type": "object"
81 }
82 }
83 ]
84 }
85 },
86 "resources/list": {
87 "result": {
88 "resources": [
89 {
90 "uri": "fixture://readme",
91 "name": "readme",
92 "description": "The fixture readme.",
93 "mimeType": "text/plain"
94 }
95 ]
96 }
97 },
98 "resources/templates/list": {
99 "result": {
100 "resourceTemplates": [
101 {
102 "uriTemplate": "fixture://notes/{id}",
103 "name": "note",
104 "mimeType": "text/plain"
105 }
106 ]
107 }
108 },
109 "prompts/list": {
110 "result": {
111 "prompts": [
112 {
113 "name": "summarize",
114 "description": "Summarize a note.",
115 "arguments": [
116 {
117 "name": "id",
118 "required": true
119 }
120 ]
121 }
122 ]
123 }
124 },
125 "resources/read": [
126 {
127 "match": {
128 "uri": "fixture://readme"
129 },
130 "result": {
131 "contents": [
132 {
133 "uri": "fixture://readme",
134 "mimeType": "text/plain",
135 "text": "conformance fixture\n"
136 }
137 ]
138 }
139 }
140 ],
141 "prompts/get": [
142 {
143 "match": {
144 "name": "summarize"
145 },
146 "result": {
147 "description": "Summarize a note.",
148 "messages": [
149 {
150 "role": "user",
151 "content": {
152 "type": "text",
153 "text": "Summarize note 7."
154 }
155 }
156 ]
157 }
158 }
159 ],
160 "tools/call": [
161 {
162 "match": {
163 "name": "echo"
164 },
165 "result": {
166 "content": [
167 {
168 "type": "text",
169 "text": "echo: hi"
170 }
171 ],
172 "structuredContent": {
173 "echoed": "hi"
174 }
175 }
176 },
177 {
178 "match": {
179 "name": "fails"
180 },
181 "result": {
182 "content": [
183 {
184 "type": "text",
185 "text": "the fixture tool failed on purpose"
186 }
187 ],
188 "isError": true
189 }
190 },
191 {
192 "match": {
193 "name": "rpc-error"
194 },
195 "error": {
196 "code": -32602,
197 "message": "invalid params: conformance"
198 }
199 },
200 {
201 "match": {
202 "name": "slow"
203 },
204 "progress": [
205 {
206 "progress": 1,
207 "total": 2
208 },
209 {
210 "progress": 2,
211 "total": 2
212 }
213 ],
214 "result": {
215 "content": [
216 {
217 "type": "text",
218 "text": "slow done"
219 }
220 ]
221 }
222 },
223 {
224 "match": {
225 "name": "hangs"
226 },
227 "hold": true
228 },
229 {
230 "match": {
231 "name": "image"
232 },
233 "result": {
234 "content": [
235 {
236 "type": "text",
237 "text": "one pixel"
238 },
239 {
240 "type": "image",
241 "mimeType": "image/png",
242 "data": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8DwHwAFBQIAX8jx0gAAAABJRU5ErkJggg=="
243 }
244 ]
245 }
246 },
247 {
248 "match": {
249 "name": "z_last"
250 },
251 "result": {
252 "content": [
253 {
254 "type": "text",
255 "text": "z"
256 }
257 ]
258 }
259 }
260 ]
261 },
262 "steps": [
263 {
264 "op": "catalog"
265 },
266 {
267 "op": "call",
268 "tool": "mcp_conformance_echo",
269 "input": {
270 "text": "hi"
271 }
272 },
273 {
274 "op": "call",
275 "tool": "mcp_conformance_fails",
276 "input": {}
277 },
278 {
279 "op": "call",
280 "tool": "mcp_conformance_rpc-error",
281 "input": {}
282 },
283 {
284 "op": "call",
285 "tool": "mcp_conformance_slow",
286 "input": {}
287 },
288 {
289 "op": "call",
290 "tool": "mcp_conformance_image",
291 "input": {}
292 },
293 {
294 "op": "call",
295 "tool": "mcp_conformance_hangs",
296 "input": {},
297 "cancel": "after_server_holds"
298 },
299 {
300 "op": "call",
301 "tool": "mcp_conformance_echo",
302 "input": {
303 "text": "after cancel"
304 }
305 },
306 {
307 "op": "call",
308 "tool": "list_mcp_resources",
309 "input": {}
310 },
311 {
312 "op": "call",
313 "tool": "list_mcp_resource_templates",
314 "input": {}
315 },
316 {
317 "op": "call",
318 "tool": "mcp_read_resource",
319 "input": {
320 "server": "conformance",
321 "uri": "fixture://readme"
322 }
323 },
324 {
325 "op": "call",
326 "tool": "mcp_get_prompt",
327 "input": {
328 "server": "conformance",
329 "name": "summarize",
330 "arguments": {
331 "id": "7"
332 }
333 }
334 },
335 {
336 "op": "call",
337 "tool": "mcp_conformance_not_advertised",
338 "input": {}
339 }
340 ]
341 }
342
342 lines JSON