You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
blockNumber: z.string().optional().describe("Block number to explore. If not provided, latest block will be used."),
15
-
network: z.string().optional().describe("Network name (e.g., 'ethereum', 'optimism', 'arbitrum', 'base', etc.) or chain ID. Supports all EVM-compatible networks. Defaults to Ethereum mainnet.")
13
+
description: "Explore information about a specific block",
14
+
argsSchema: {
15
+
blockNumber: z.string().optional().describe("Block number to explore. If not provided, latest block will be used."),
16
+
network: z.string().optional().describe("Network name or chain ID. Defaults to Ethereum mainnet.")
17
+
}
16
18
},
17
19
({ blockNumber, network ="ethereum"})=>({
18
20
messages: [{
19
21
role: "user",
20
22
content: {
21
23
type: "text",
22
-
text: blockNumber
24
+
text: blockNumber
23
25
? `Please analyze block #${blockNumber} on the ${network} network and provide information about its key metrics, transactions, and significance.`
24
26
: `Please analyze the latest block on the ${network} network and provide information about its key metrics, transactions, and significance.`
25
27
}
@@ -28,12 +30,14 @@ export function registerEVMPrompts(server: McpServer) {
28
30
);
29
31
30
32
// Transaction analysis prompt
31
-
server.prompt(
33
+
server.registerPrompt(
32
34
"analyze_transaction",
33
-
"Analyze a specific transaction",
34
35
{
35
-
txHash: z.string().describe("Transaction hash to analyze"),
36
-
network: z.string().optional().describe("Network name (e.g., 'ethereum', 'optimism', 'arbitrum', 'base', etc.) or chain ID. Supports all EVM-compatible networks. Defaults to Ethereum mainnet.")
36
+
description: "Analyze a specific transaction",
37
+
argsSchema: {
38
+
txHash: z.string().describe("Transaction hash to analyze"),
39
+
network: z.string().optional().describe("Network name or chain ID. Defaults to Ethereum mainnet.")
40
+
}
37
41
},
38
42
({ txHash, network ="ethereum"})=>({
39
43
messages: [{
@@ -47,12 +51,14 @@ export function registerEVMPrompts(server: McpServer) {
47
51
);
48
52
49
53
// Address analysis prompt
50
-
server.prompt(
54
+
server.registerPrompt(
51
55
"analyze_address",
52
-
"Analyze an EVM address",
53
56
{
54
-
address: z.string().describe("Ethereum address to analyze"),
55
-
network: z.string().optional().describe("Network name (e.g., 'ethereum', 'optimism', 'arbitrum', 'base', etc.) or chain ID. Supports all EVM-compatible networks. Defaults to Ethereum mainnet.")
57
+
description: "Analyze an EVM address",
58
+
argsSchema: {
59
+
address: z.string().describe("Ethereum address to analyze"),
60
+
network: z.string().optional().describe("Network name or chain ID. Defaults to Ethereum mainnet.")
61
+
}
56
62
},
57
63
({ address, network ="ethereum"})=>({
58
64
messages: [{
@@ -66,33 +72,37 @@ export function registerEVMPrompts(server: McpServer) {
66
72
);
67
73
68
74
// Smart contract interaction guidance
69
-
server.prompt(
75
+
server.registerPrompt(
70
76
"interact_with_contract",
71
-
"Get guidance on interacting with a smart contract",
? `I need to interact with the smart contract at address ${contractAddress} on the ${network} network. Here's the ABI:\n\n${abiJson}\n\nPlease analyze this contract's functions and provide guidance on how to interact with it safely. Explain what each function does and what parameters it requires.`
91
+
? `I need to interact with the smart contract at address ${contractAddress} on the ${network} network. Here's the ABI:\n\n${abiJson}\n\nPlease analyze this contract's functions and provide guidance on how to interact with it safely.`
84
92
: `I need to interact with the smart contract at address ${contractAddress} on the ${network} network. Please help me understand what this contract does and how I can interact with it safely.`
85
93
}
86
94
}]
87
95
})
88
96
);
89
97
90
98
// EVM concept explanation
91
-
server.prompt(
99
+
server.registerPrompt(
92
100
"explain_evm_concept",
93
-
"Get an explanation of an EVM concept",
94
101
{
95
-
concept: z.string().describe("The EVM concept to explain (e.g., gas, nonce, etc.)")
102
+
description: "Get an explanation of an EVM concept",
103
+
argsSchema: {
104
+
concept: z.string().describe("The EVM concept to explain (e.g., gas, nonce, etc.)")
105
+
}
96
106
},
97
107
({ concept })=>({
98
108
messages: [{
@@ -106,11 +116,13 @@ export function registerEVMPrompts(server: McpServer) {
106
116
);
107
117
108
118
// Network comparison
109
-
server.prompt(
119
+
server.registerPrompt(
110
120
"compare_networks",
111
-
"Compare different EVM-compatible networks",
112
121
{
113
-
networkList: z.string().describe("Comma-separated list of networks to compare (e.g., 'ethereum,optimism,arbitrum')")
122
+
description: "Compare different EVM-compatible networks",
123
+
argsSchema: {
124
+
networkList: z.string().describe("Comma-separated list of networks to compare")
@@ -127,24 +139,26 @@ export function registerEVMPrompts(server: McpServer) {
127
139
);
128
140
129
141
// Token analysis prompt
130
-
server.prompt(
142
+
server.registerPrompt(
131
143
"analyze_token",
132
-
"Analyze an ERC20 or NFT token",
133
144
{
134
-
tokenAddress: z.string().describe("Token contract address to analyze"),
135
-
tokenType: z.string().optional().describe("Type of token to analyze (erc20, erc721/nft, or auto-detect). Defaults to auto."),
136
-
tokenId: z.string().optional().describe("Token ID (required for NFT analysis)"),
137
-
network: z.string().optional().describe("Network name (e.g., 'ethereum', 'optimism', 'arbitrum', 'base', etc.) or chain ID. Supports all EVM-compatible networks. Defaults to Ethereum mainnet.")
145
+
description: "Analyze an ERC20 or NFT token",
146
+
argsSchema: {
147
+
tokenAddress: z.string().describe("Token contract address to analyze"),
148
+
tokenType: z.string().optional().describe("Type of token (erc20, erc721/nft, or auto-detect)"),
149
+
tokenId: z.string().optional().describe("Token ID (required for NFT analysis)"),
150
+
network: z.string().optional().describe("Network name or chain ID. Defaults to Ethereum mainnet.")
promptText=`Please analyze the ERC20 token at address ${tokenAddress} on the ${network} network. Provide information about its name, symbol, total supply, and any other relevant details. If possible, explain the token's purpose, utility, and market context.`;
157
+
promptText=`Please analyze the ERC20 token at address ${tokenAddress} on the ${network} network. Provide information about its name, symbol, total supply, and any other relevant details.`;
promptText=`Please analyze the NFT with token ID ${tokenId} from the collection at address ${tokenAddress} on the ${network} network. Provide information about the collection name, token details, ownership history if available, and any other relevant information about this specific NFT.`;
159
+
promptText=`Please analyze the NFT with token ID ${tokenId} from the collection at address ${tokenAddress} on the ${network} network. Provide information about the collection name, token details, and any other relevant information.`;
146
160
}elseif(tokenType==="nft"||tokenType==="erc721"){
147
-
promptText=`Please analyze the NFT collection at address ${tokenAddress} on the ${network} network. Provide information about the collection name, symbol, total supply if available, floor price if available, and any other relevant details about this NFT collection.`;
161
+
promptText=`Please analyze the NFT collection at address ${tokenAddress} on the ${network} network. Provide information about the collection name, symbol, total supply if available, and any other relevant details.`;
148
162
}
149
163
150
164
return{
@@ -158,5 +172,4 @@ export function registerEVMPrompts(server: McpServer) {
0 commit comments