MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / registerAgentTools

Function registerAgentTools

mcp/src/tools/agents.ts:6–237  ·  view source on GitHub ↗
(server: McpServer, client: McpClient)

Source from the content-addressed store, hash-verified

4import { runTool, strictInputSchema } from "./util.js";
5
6export function registerAgentTools(server: McpServer, client: McpClient): void {
7 server.registerTool(
8 "list_agents",
9 {
10 title: "List agents",
11 annotations: { readOnlyHint: true },
12 description:
13 "List every agent inbox owned by the authenticated user. Useful for orientation — which inbox to send `from` or query messages against. Read-only.",
14 inputSchema: strictInputSchema({}),
15 },
16 async () => runTool(async () => ({ agents: await client.listAgents() })),
17 );
18
19 server.registerTool(
20 "get_agent",
21 {
22 title: "Get one agent's configuration",
23 annotations: { readOnlyHint: true },
24 description:
25 "Fetch a single agent by its email address — identity + status (name, domain, verification, created_at). The screening/protection config (gate, scan, holds) is NOT here: it is account-only and lives on `get_protection`. Use to inspect or confirm one agent without listing every agent. Read-only.",
26 inputSchema: strictInputSchema({
27 email: z
28 .string()
29 .email()
30 .describe("Agent to fetch (full email, e.g. support@acme.com)."),
31 }),
32 },
33 async (args) => runTool(() => client.getAgent(args.email)),
34 );
35
36 server.registerTool(
37 "whoami",
38 {
39 title: "Get the authenticated account's identity",
40 annotations: { readOnlyHint: true },
41 description:
42 "Use first when starting work on e2a to learn WHO you are: the authenticated user (email), the credential's scope (`account` or `agent`), and your plan + usage limits. For an agent-scoped credential it also returns `agent_address` — the single agent that credential IS. Account-scoped credentials own many agents; discover them with `list_agents`. This is identity, not an agent — it never guesses a 'default' agent.",
43 inputSchema: strictInputSchema({}),
44 },
45 async () => runTool(() => client.whoami()),
46 );
47
48 server.registerTool(
49 "create_agent",
50 {
51 title: "Create a new agent inbox",
52 annotations: { destructiveHint: false },
53 description:
54 "Register a new agent by its full email address. For a custom domain, the domain must be one you've registered and verified (`register_domain` → `verify_domain` → poll `get_domain` for sending). For the deployment's shared domain, just use an email on it (e.g. support-bot@<shared-domain>). Inbound is always available via `list_messages` (poll) or a `create_webhook` subscription — there is no delivery 'mode' to choose. Returns the full agent.",
55 inputSchema: strictInputSchema({
56 email: z
57 .string()
58 .email()
59 .describe(
60 "Full email address of the new agent, e.g. support@acme.com. The domain must be a verified domain you own, or the deployment's shared domain.",
61 ),
62 name: z
63 .string()

Callers 2

buildServerFunction · 0.85
tools.test.tsFile · 0.85

Calls 10

strictInputSchemaFunction · 0.85
runToolFunction · 0.85
updateProtectionMethod · 0.80
listAgentsMethod · 0.45
getAgentMethod · 0.45
whoamiMethod · 0.45
createAgentMethod · 0.45
updateAgentMethod · 0.45
getProtectionMethod · 0.45
deleteAgentMethod · 0.45

Tested by

no test coverage detected