Merge pull request #64 from sambostock/duplicate-method-instrumentation
Remove duplicate `method` instrumentation
This commit is contained in:
commit
ffa06b103d
1 changed files with 0 additions and 10 deletions
|
|
@ -202,7 +202,6 @@ module MCP
|
||||||
end
|
end
|
||||||
|
|
||||||
def init(request)
|
def init(request)
|
||||||
add_instrumentation_data(method: Methods::INITIALIZE)
|
|
||||||
{
|
{
|
||||||
protocolVersion: configuration.protocol_version,
|
protocolVersion: configuration.protocol_version,
|
||||||
capabilities: capabilities,
|
capabilities: capabilities,
|
||||||
|
|
@ -211,12 +210,10 @@ module MCP
|
||||||
end
|
end
|
||||||
|
|
||||||
def list_tools(request)
|
def list_tools(request)
|
||||||
add_instrumentation_data(method: Methods::TOOLS_LIST)
|
|
||||||
@tools.map { |_, tool| tool.to_h }
|
@tools.map { |_, tool| tool.to_h }
|
||||||
end
|
end
|
||||||
|
|
||||||
def call_tool(request)
|
def call_tool(request)
|
||||||
add_instrumentation_data(method: Methods::TOOLS_CALL)
|
|
||||||
tool_name = request[:name]
|
tool_name = request[:name]
|
||||||
tool = tools[tool_name]
|
tool = tools[tool_name]
|
||||||
unless tool
|
unless tool
|
||||||
|
|
@ -250,12 +247,10 @@ module MCP
|
||||||
end
|
end
|
||||||
|
|
||||||
def list_prompts(request)
|
def list_prompts(request)
|
||||||
add_instrumentation_data(method: Methods::PROMPTS_LIST)
|
|
||||||
@prompts.map { |_, prompt| prompt.to_h }
|
@prompts.map { |_, prompt| prompt.to_h }
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_prompt(request)
|
def get_prompt(request)
|
||||||
add_instrumentation_data(method: Methods::PROMPTS_GET)
|
|
||||||
prompt_name = request[:name]
|
prompt_name = request[:name]
|
||||||
prompt = @prompts[prompt_name]
|
prompt = @prompts[prompt_name]
|
||||||
unless prompt
|
unless prompt
|
||||||
|
|
@ -272,21 +267,16 @@ module MCP
|
||||||
end
|
end
|
||||||
|
|
||||||
def list_resources(request)
|
def list_resources(request)
|
||||||
add_instrumentation_data(method: Methods::RESOURCES_LIST)
|
|
||||||
|
|
||||||
@resources.map(&:to_h)
|
@resources.map(&:to_h)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Server implementation should set `resources_read_handler` to override no-op default
|
# Server implementation should set `resources_read_handler` to override no-op default
|
||||||
def read_resource_no_content(request)
|
def read_resource_no_content(request)
|
||||||
add_instrumentation_data(method: Methods::RESOURCES_READ)
|
|
||||||
add_instrumentation_data(resource_uri: request[:uri])
|
add_instrumentation_data(resource_uri: request[:uri])
|
||||||
[]
|
[]
|
||||||
end
|
end
|
||||||
|
|
||||||
def list_resource_templates(request)
|
def list_resource_templates(request)
|
||||||
add_instrumentation_data(method: Methods::RESOURCES_TEMPLATES_LIST)
|
|
||||||
|
|
||||||
@resource_templates.map(&:to_h)
|
@resource_templates.map(&:to_h)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue