Skip to content

Commit ddad8ed

Browse files
committed
chore: add nudge to example
1 parent f3143c5 commit ddad8ed

2 files changed

Lines changed: 27 additions & 6 deletions

File tree

examples/server/app/graph/graph.tsx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,29 @@ const CustomAvatarXAxisTick = (props: { x: number, y: number, payload: { value:
235235
width={baseAvatarSize} // Image base size is constant
236236
clipPath="url(#clipCircle)" // Clip path is for a 24x24 image starting at 0,0
237237
/>
238+
{isHovered && (
239+
<g>
240+
<rect
241+
x={baseAvatarSize / 2 - 22} // Center the tooltip background
242+
y={-18} // Position above the avatar
243+
width={44} // Width of the tooltip background
244+
height={16} // Height of the tooltip background
245+
rx={3} // Rounded corners for the background
246+
ry={3}
247+
fill="rgba(0,0,0,0.75)"
248+
/>
249+
<text
250+
x={baseAvatarSize / 2} // Center the text
251+
y={-7} // Position above the avatar, vertically centered in the rect
252+
fill="#FFFFFF"
253+
fontSize="10px"
254+
textAnchor="middle"
255+
style={{ pointerEvents: 'none' }} // Ensure text doesn't interfere with mouse events on avatar
256+
>
257+
Nudge
258+
</text>
259+
</g>
260+
)}
238261
</g>
239262
);
240263
}

examples/server/src/index.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,14 @@ export class MyMCP extends McpAgent {
3131
const url = new URL(requestUrl);
3232
const requestHost = url.host;
3333

34-
// Simple addition tool
3534
this.server.tool(
36-
"add",
37-
{ a: z.number(), b: z.number() },
38-
async ({ a, b }) => ({
39-
content: [{ type: "text", text: String(a + b) }],
35+
"nudge_team_member",
36+
{ name: z.string() },
37+
async ({ name }) => ({
38+
content: [{ type: "text", text: "Nudged " + name + "!" }],
4039
})
4140
);
4241

43-
// Calculator tool with multiple operations
4442
this.server.tool(
4543
"show_task_status",
4644
"Displays a UI for the user to see the status of tasks",

0 commit comments

Comments
 (0)