Skip to content

Commit ffa06b1

Browse files
authored
Merge pull request #64 from sambostock/duplicate-method-instrumentation
Remove duplicate `method` instrumentation
2 parents 0027ce7 + ce1c871 commit ffa06b1

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

lib/mcp/server.rb

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ def server_info
202202
end
203203

204204
def init(request)
205-
add_instrumentation_data(method: Methods::INITIALIZE)
206205
{
207206
protocolVersion: configuration.protocol_version,
208207
capabilities: capabilities,
@@ -211,12 +210,10 @@ def init(request)
211210
end
212211

213212
def list_tools(request)
214-
add_instrumentation_data(method: Methods::TOOLS_LIST)
215213
@tools.map { |_, tool| tool.to_h }
216214
end
217215

218216
def call_tool(request)
219-
add_instrumentation_data(method: Methods::TOOLS_CALL)
220217
tool_name = request[:name]
221218
tool = tools[tool_name]
222219
unless tool
@@ -250,12 +247,10 @@ def call_tool(request)
250247
end
251248

252249
def list_prompts(request)
253-
add_instrumentation_data(method: Methods::PROMPTS_LIST)
254250
@prompts.map { |_, prompt| prompt.to_h }
255251
end
256252

257253
def get_prompt(request)
258-
add_instrumentation_data(method: Methods::PROMPTS_GET)
259254
prompt_name = request[:name]
260255
prompt = @prompts[prompt_name]
261256
unless prompt
@@ -272,21 +267,16 @@ def get_prompt(request)
272267
end
273268

274269
def list_resources(request)
275-
add_instrumentation_data(method: Methods::RESOURCES_LIST)
276-
277270
@resources.map(&:to_h)
278271
end
279272

280273
# Server implementation should set `resources_read_handler` to override no-op default
281274
def read_resource_no_content(request)
282-
add_instrumentation_data(method: Methods::RESOURCES_READ)
283275
add_instrumentation_data(resource_uri: request[:uri])
284276
[]
285277
end
286278

287279
def list_resource_templates(request)
288-
add_instrumentation_data(method: Methods::RESOURCES_TEMPLATES_LIST)
289-
290280
@resource_templates.map(&:to_h)
291281
end
292282

0 commit comments

Comments
 (0)