Skip to content

Commit 48849be

Browse files
update dependencies (#659)
* update dependencies * feat: use custom meta for price discovery. * fix rebase * fix: streamable test * more updates --------- Co-authored-by: Matt Carey <[email protected]>
1 parent 0b7a30e commit 48849be

File tree

34 files changed

+8753
-6645
lines changed

34 files changed

+8753
-6645
lines changed

.changeset/tired-birds-design.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"hono-agents": patch
3+
"agents": patch
4+
---
5+
6+
update dependencies

biome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.3.4/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.3.7/schema.json",
33
"assist": {
44
"actions": {
55
"source": {

docs/mcp-servers.md

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@ export class TinyMcp extends McpAgent {
1616
server = new McpServer({ name: "", version: "v1.0.0" });
1717

1818
async init() {
19-
this.server.tool(
19+
this.server.registerTool(
2020
"square",
21-
"Squares a number",
22-
{ number: z.number() },
21+
{
22+
description: "Squares a number",
23+
inputSchema: { number: z.number() }
24+
},
2325
async ({ number }) => ({
2426
content: [{ type: "text", text: String(number ** 2) }]
25-
})
27+
}
2628
);
2729
}
2830
}
@@ -91,12 +93,14 @@ export class StorageMcp extends McpAgent {
9193
content: [{ type: "text" as const, text }]
9294
});
9395

94-
this.server.tool(
96+
this.server.registerTool(
9597
"writeFile",
96-
"Store text as a file with the given path",
9798
{
98-
path: z.string().describe("Absolute path of the file"),
99-
content: z.string().describe("The content to store")
99+
description: "Store text as a file with the given path",
100+
inputSchema: {
101+
path: z.string().describe("Absolute path of the file"),
102+
content: z.string().describe("The content to store")
103+
}
100104
},
101105
async ({ path, content }) => {
102106
try {
@@ -108,11 +112,13 @@ export class StorageMcp extends McpAgent {
108112
}
109113
);
110114

111-
this.server.tool(
115+
this.server.registerTool(
112116
"readFile",
113-
"Read the contents of a file",
114117
{
115-
path: z.string().describe("Absolute path of the file to read")
118+
description: "Read the contents of a file",
119+
inputSchema: {
120+
path: z.string().describe("Absolute path of the file to read")
121+
}
116122
},
117123
async ({ path }) => {
118124
const obj = await env.BUCKET.get(path);
@@ -126,9 +132,15 @@ export class StorageMcp extends McpAgent {
126132
}
127133
);
128134

129-
this.server.tool("whoami", "Check who the user is", async () => {
130-
return textRes(`${this.props?.userId}`);
131-
});
135+
this.server.registerTool(
136+
"whoami",
137+
{
138+
description: "Check who the user is"
139+
},
140+
async () => {
141+
return textRes(`${this.props?.userId}`);
142+
}
143+
);
132144
}
133145
}
134146

examples/a2a/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"author": "Matt Carey <[email protected]>",
55
"dependencies": {
66
"@a2a-js/sdk": "^0.2.2",
7-
"hono": "^4.10.4"
7+
"hono": "^4.10.6"
88
},
99
"keywords": [],
1010
"scripts": {

examples/mcp-elicitation/src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ export class MyAgent extends Agent<Env, State> {
7070
amount: {
7171
type: "number",
7272
title: "Amount",
73-
description: "The amount to increase the counter by",
74-
minLength: 1
73+
description: "The amount to increase the counter by"
7574
}
7675
},
7776
required: ["amount"]

examples/mcp-worker-authenticated/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
"deploy": "wrangler deploy"
1111
},
1212
"dependencies": {
13-
"hono": "^4.10.4"
13+
"hono": "^4.10.6"
1414
}
1515
}

examples/mcp-worker-authenticated/src/index.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ const server = new McpServer({
99
version: "1.0.0"
1010
});
1111

12-
server.tool(
12+
server.registerTool(
1313
"hello",
14-
"Returns a greeting message",
15-
{ name: z.string().optional() },
14+
{
15+
description: "Returns a greeting message",
16+
inputSchema: { name: z.string().optional() }
17+
},
1618
async ({ name }) => {
1719
const auth = getMcpAuthContext();
1820
const username = auth?.props?.username as string | undefined;
@@ -28,10 +30,11 @@ server.tool(
2830
}
2931
);
3032

31-
server.tool(
33+
server.registerTool(
3234
"whoami",
33-
"Returns information about the authenticated user",
34-
{},
35+
{
36+
description: "Returns information about the authenticated user"
37+
},
3538
async () => {
3639
const auth = getMcpAuthContext();
3740

@@ -40,7 +43,7 @@ server.tool(
4043
content: [
4144
{
4245
text: "No authentication context available",
43-
type: "text"
46+
type: "text" as const
4447
}
4548
]
4649
};
@@ -58,7 +61,7 @@ server.tool(
5861
null,
5962
2
6063
),
61-
type: "text"
64+
type: "text" as const
6265
}
6366
]
6467
};

examples/mcp-worker/src/index.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ const server = new McpServer({
99
version: "1.0.0"
1010
});
1111

12-
server.tool(
12+
server.registerTool(
1313
"hello",
14-
"Returns a greeting message",
15-
{ name: z.string().optional() },
14+
{
15+
description: "Returns a greeting message",
16+
inputSchema: { name: z.string().optional() }
17+
},
1618
async ({ name }) => {
1719
return {
1820
content: [

examples/mcp/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,14 @@ export class MyMCP extends McpAgent<Env> {
2929
// ...
3030
});
3131

32-
this.server.tool(
32+
this.server.registerTool(
3333
"add",
34-
"Add to the counter, stored in the MCP",
35-
{ a: z.number() },
34+
{
35+
description: "Add to the counter, stored in the MCP",
36+
inputSchema: { a: z.number() }
37+
},
3638
async ({ a }) => {
37-
// ...
39+
// add your logic here
3840
}
3941
);
4042
}

examples/mcp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"author": "",
33
"dependencies": {
4-
"mcp-remote": "^0.1.30"
4+
"mcp-remote": "^0.1.31"
55
},
66
"keywords": [],
77
"name": "@cloudflare/agents-mcp-example",

0 commit comments

Comments
 (0)