Merge branch 'main' into main

This commit is contained in:
Nicolás Montone
2025-04-01 15:10:10 -03:00
committed by GitHub
6 changed files with 50 additions and 14 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@modelcontextprotocol/inspector-client",
"version": "0.7.0",
"version": "0.8.0",
"description": "Client-side application for the Model Context Protocol inspector",
"license": "MIT",
"author": "Anthropic, PBC (https://anthropic.com)",

View File

@@ -220,7 +220,11 @@ const ToolsTab = ({
</div>
) : (
<Input
type={prop.type === "number" ? "number" : "text"}
type={
prop.type === "number" || prop.type === "integer"
? "number"
: "text"
}
id={key}
name={key}
placeholder={prop.description}
@@ -229,7 +233,8 @@ const ToolsTab = ({
setParams({
...params,
[key]:
prop.type === "number"
prop.type === "number" ||
prop.type === "integer"
? Number(e.target.value)
: e.target.value,
})

View File

@@ -17,6 +17,16 @@ describe("ToolsTab", () => {
},
},
},
{
name: "tool3",
description: "Integer tool",
inputSchema: {
type: "object" as const,
properties: {
count: { type: "integer" as const },
},
},
},
{
name: "tool2",
description: "Second tool",
@@ -62,7 +72,7 @@ describe("ToolsTab", () => {
// Switch to second tool
rerender(
<Tabs defaultValue="tools">
<ToolsTab {...defaultProps} selectedTool={mockTools[1]} />
<ToolsTab {...defaultProps} selectedTool={mockTools[2]} />
</Tabs>,
);
@@ -71,6 +81,7 @@ describe("ToolsTab", () => {
expect(newInput.value).toBe("");
});
it("should display error message when error prop is provided", () => {
const errorMessage = "Test error message";
renderToolsTab({
@@ -81,5 +92,25 @@ describe("ToolsTab", () => {
// Verify error message is displayed
expect(screen.getByText("Error")).toBeTruthy();
expect(screen.getByText(errorMessage)).toBeTruthy();
});
it("should handle integer type inputs", () => {
renderToolsTab({
selectedTool: mockTools[1], // Use the tool with integer type
});
const input = screen.getByRole("spinbutton", {
name: /count/i,
}) as HTMLInputElement;
expect(input).toHaveProperty("type", "number");
fireEvent.change(input, { target: { value: "42" } });
expect(input.value).toBe("42");
const submitButton = screen.getByRole("button", { name: /run tool/i });
fireEvent.click(submitButton);
expect(defaultProps.callTool).toHaveBeenCalledWith(mockTools[1].name, {
count: 42,
});
});
});

12
package-lock.json generated
View File

@@ -1,20 +1,20 @@
{
"name": "@modelcontextprotocol/inspector",
"version": "0.7.0",
"version": "0.8.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@modelcontextprotocol/inspector",
"version": "0.7.0",
"version": "0.8.0",
"license": "MIT",
"workspaces": [
"client",
"server"
],
"dependencies": {
"@modelcontextprotocol/inspector-client": "^0.7.0",
"@modelcontextprotocol/inspector-server": "^0.7.0",
"@modelcontextprotocol/inspector-client": "^0.8.0",
"@modelcontextprotocol/inspector-server": "^0.8.0",
"concurrently": "^9.0.1",
"shell-quote": "^1.8.2",
"spawn-rx": "^5.1.2",
@@ -32,7 +32,7 @@
},
"client": {
"name": "@modelcontextprotocol/inspector-client",
"version": "0.7.0",
"version": "0.8.0",
"license": "MIT",
"dependencies": {
"@modelcontextprotocol/sdk": "^1.6.1",
@@ -11571,7 +11571,7 @@
},
"server": {
"name": "@modelcontextprotocol/inspector-server",
"version": "0.7.0",
"version": "0.8.0",
"license": "MIT",
"dependencies": {
"@modelcontextprotocol/sdk": "^1.6.1",

View File

@@ -1,6 +1,6 @@
{
"name": "@modelcontextprotocol/inspector",
"version": "0.7.0",
"version": "0.8.0",
"description": "Model Context Protocol inspector",
"license": "MIT",
"author": "Anthropic, PBC (https://anthropic.com)",
@@ -36,8 +36,8 @@
"publish-all": "npm publish --workspaces --access public && npm publish --access public"
},
"dependencies": {
"@modelcontextprotocol/inspector-client": "^0.7.0",
"@modelcontextprotocol/inspector-server": "^0.7.0",
"@modelcontextprotocol/inspector-client": "^0.8.0",
"@modelcontextprotocol/inspector-server": "^0.8.0",
"concurrently": "^9.0.1",
"shell-quote": "^1.8.2",
"spawn-rx": "^5.1.2",

View File

@@ -1,6 +1,6 @@
{
"name": "@modelcontextprotocol/inspector-server",
"version": "0.7.0",
"version": "0.8.0",
"description": "Server-side application for the Model Context Protocol inspector",
"license": "MIT",
"author": "Anthropic, PBC (https://anthropic.com)",