@telegraphprotocol/telegraph-protocol-mcp 2.1.1 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/anjoman/SKILL.md +104 -0
- package/.agents/skills/anjoman/scripts/anjoman.mjs +615 -0
- package/.agents/skills/telegraph/SKILL.md +70 -69
- package/LICENSE +21 -21
- package/README.md +128 -119
- package/dist/api.d.ts +15 -2
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +26 -4
- package/dist/api.js.map +1 -1
- package/dist/chain.d.ts +16 -12
- package/dist/chain.d.ts.map +1 -1
- package/dist/chain.js +45 -29
- package/dist/chain.js.map +1 -1
- package/dist/cli.js +26 -21
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +4 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +17 -2
- package/dist/config.js.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/pay.d.ts +2 -0
- package/dist/pay.d.ts.map +1 -1
- package/dist/pay.js +20 -2
- package/dist/pay.js.map +1 -1
- package/dist/tools.d.ts +6 -2
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +104 -41
- package/dist/tools.js.map +1 -1
- package/guides/1-getting-started.md +44 -42
- package/guides/2-payments.md +44 -43
- package/guides/3-intents-and-ranking.md +29 -29
- package/guides/4-troubleshooting.md +45 -41
- package/package.json +63 -63
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
# Intents, miners and ranking
|
|
2
|
-
|
|
3
|
-
## Intents
|
|
4
|
-
|
|
5
|
-
An intent is one kind of question, such as `CRYPTO_PRICE_USD`, `WEATHER_CHECK_TEMPERATURE` or `CODE_REVIEW_GENERAL`. Every miner declares the intents it serves. `telegraph_find_intents` searches them.
|
|
6
|
-
|
|
7
|
-
Intents come in families: a family name (a prefix such as `WEATHER_CHECK`) groups the intents that extend it with `_`. You ask an intent, never a family.
|
|
8
|
-
|
|
9
|
-
## Kinds
|
|
10
|
-
|
|
11
|
-
Each intent has a kind, which decides how its miners are checked:
|
|
12
|
-
|
|
13
|
-
- **deterministic**: one correct answer the network can confirm from public sources (a price, a rate, a temperature). Miners are compared with that answer.
|
|
14
|
-
- **hybrid**: a checkable fact plus a judged part.
|
|
15
|
-
- **judgment**: no single correct answer (a review, an analysis). A trained model scores the answers.
|
|
16
|
-
|
|
17
|
-
## Asking well
|
|
18
|
-
|
|
19
|
-
A plain question works: the node reads the intent and its params from it. To be exact, send `intent` and `params` as `telegraph_intent` lists them, for example `{"intent": "WEATHER_CHECK_TEMPERATURE", "params": {"location": "Lahore"}}`. With an intent, only that intent's miners answer; if none is live, the ask is refused before payment.
|
|
20
|
-
|
|
21
|
-
The answer comes back in the intent's fields (`answer` in the tool result), with `field_status` saying which fields were found. When the fields can't be read, `result_shape` is `raw` and the answer is the miner's own reply.
|
|
22
|
-
|
|
23
|
-
## Ranking
|
|
24
|
-
|
|
25
|
-
Every epoch (one hour on beta 2) the network asks each intent's miners questions and scores the answers. `telegraph_ranking` shows the result. An ask goes to the top live miner, with the next one as a fallback. A miner that stops answering is taken out of routing.
|
|
26
|
-
|
|
27
|
-
## Intents without a ranking
|
|
28
|
-
|
|
29
|
-
Some intents are not ranked yet: deterministic ones need reference answers from several independent sources, and judgment ones need a trained model. An ask for such an intent goes to a miner the node's language model picks, which is less reliable. `telegraph_intent` says when an intent has no ranking.
|
|
1
|
+
# Intents, miners and ranking
|
|
2
|
+
|
|
3
|
+
## Intents
|
|
4
|
+
|
|
5
|
+
An intent is one kind of question, such as `CRYPTO_PRICE_USD`, `WEATHER_CHECK_TEMPERATURE` or `CODE_REVIEW_GENERAL`. Every miner declares the intents it serves. `telegraph_find_intents` searches them.
|
|
6
|
+
|
|
7
|
+
Intents come in families: a family name (a prefix such as `WEATHER_CHECK`) groups the intents that extend it with `_`. You ask an intent, never a family.
|
|
8
|
+
|
|
9
|
+
## Kinds
|
|
10
|
+
|
|
11
|
+
Each intent has a kind, which decides how its miners are checked:
|
|
12
|
+
|
|
13
|
+
- **deterministic**: one correct answer the network can confirm from public sources (a price, a rate, a temperature). Miners are compared with that answer.
|
|
14
|
+
- **hybrid**: a checkable fact plus a judged part.
|
|
15
|
+
- **judgment**: no single correct answer (a review, an analysis). A trained model scores the answers.
|
|
16
|
+
|
|
17
|
+
## Asking well
|
|
18
|
+
|
|
19
|
+
A plain question works: the node reads the intent and its params from it. To be exact, send `intent` and `params` as `telegraph_intent` lists them, for example `{"intent": "WEATHER_CHECK_TEMPERATURE", "params": {"location": "Lahore"}}`. With an intent, only that intent's miners answer; if none is live, the ask is refused before payment.
|
|
20
|
+
|
|
21
|
+
The answer comes back in the intent's fields (`answer` in the tool result), with `field_status` saying which fields were found. When the fields can't be read, `result_shape` is `raw` and the answer is the miner's own reply.
|
|
22
|
+
|
|
23
|
+
## Ranking
|
|
24
|
+
|
|
25
|
+
Every epoch (one hour on beta 2) the network asks each intent's miners questions and scores the answers. `telegraph_ranking` shows the result. An ask goes to the top live miner, with the next one as a fallback. A miner that stops answering is taken out of routing.
|
|
26
|
+
|
|
27
|
+
## Intents without a ranking
|
|
28
|
+
|
|
29
|
+
Some intents are not ranked yet: deterministic ones need reference answers from several independent sources, and judgment ones need a trained model. An ask for such an intent goes to a miner the node's language model picks, which is less reliable. `telegraph_intent` says when an intent has no ranking.
|
|
@@ -1,41 +1,45 @@
|
|
|
1
|
-
# Errors and fixes
|
|
2
|
-
|
|
3
|
-
## 503 could not route this question now
|
|
4
|
-
|
|
5
|
-
No miner could take the question at that moment. Nothing was charged. Retry, or ask with a specific intent.
|
|
6
|
-
|
|
7
|
-
## 503 no_compatible_miner
|
|
8
|
-
|
|
9
|
-
You named an intent that no live miner serves now. Nothing was charged. Ask without the intent, or pick another with `telegraph_find_intents`.
|
|
10
|
-
|
|
11
|
-
## 400 invalid_params
|
|
12
|
-
|
|
13
|
-
The params don't fit the intent's schema: missing, wrong type, or not allowed. `telegraph_intent` lists the params and types.
|
|
14
|
-
|
|
15
|
-
## 400 no_input_schema
|
|
16
|
-
|
|
17
|
-
That intent takes no params. Send a question only.
|
|
18
|
-
|
|
19
|
-
## 429 too many requests
|
|
20
|
-
|
|
21
|
-
Too many new questions in one minute. Wait a minute.
|
|
22
|
-
|
|
23
|
-
## 402 escrow balance too low
|
|
24
|
-
|
|
25
|
-
The escrow can't cover the ask. Nothing was charged. The user runs `npx -y @telegraphprotocol/telegraph-protocol-mcp fund` in a terminal, then asks again
|
|
26
|
-
|
|
27
|
-
##
|
|
28
|
-
|
|
29
|
-
The
|
|
30
|
-
|
|
31
|
-
##
|
|
32
|
-
|
|
33
|
-
The
|
|
34
|
-
|
|
35
|
-
##
|
|
36
|
-
|
|
37
|
-
The
|
|
38
|
-
|
|
39
|
-
##
|
|
40
|
-
|
|
41
|
-
The
|
|
1
|
+
# Errors and fixes
|
|
2
|
+
|
|
3
|
+
## 503 could not route this question now
|
|
4
|
+
|
|
5
|
+
No miner could take the question at that moment. Nothing was charged. Retry, or ask with a specific intent.
|
|
6
|
+
|
|
7
|
+
## 503 no_compatible_miner
|
|
8
|
+
|
|
9
|
+
You named an intent that no live miner serves now. Nothing was charged. Ask without the intent, or pick another with `telegraph_find_intents`.
|
|
10
|
+
|
|
11
|
+
## 400 invalid_params
|
|
12
|
+
|
|
13
|
+
The params don't fit the intent's schema: missing, wrong type, or not allowed. `telegraph_intent` lists the params and types.
|
|
14
|
+
|
|
15
|
+
## 400 no_input_schema
|
|
16
|
+
|
|
17
|
+
That intent takes no params. Send a question only.
|
|
18
|
+
|
|
19
|
+
## 429 too many requests
|
|
20
|
+
|
|
21
|
+
Too many new questions in one minute. Wait a minute.
|
|
22
|
+
|
|
23
|
+
## 402 escrow balance too low
|
|
24
|
+
|
|
25
|
+
The escrow can't cover the ask. A `telegraph_ask` holds its whole budget (`TELEGRAPH_MAX_BUDGET_USDC`, default $0.26) while it runs, so the balance must cover that. Nothing was charged. The user runs `npx -y @telegraphprotocol/telegraph-protocol-mcp fund` in a terminal, then asks again, or lowers `TELEGRAPH_MAX_BUDGET_USDC`. (Only with `TELEGRAPH_PAYMENT=auto` would the server pay from the wallet by x402 instead.)
|
|
26
|
+
|
|
27
|
+
## 400 invalid request body: max_budget_usdc
|
|
28
|
+
|
|
29
|
+
The node takes a budget from one call up to the most it allows, and says the range. Nothing was charged. Set `TELEGRAPH_MAX_BUDGET_USDC` in that range, or `0` to ask one miner only.
|
|
30
|
+
|
|
31
|
+
## Over a spending limit
|
|
32
|
+
|
|
33
|
+
The ask would cost more than `TELEGRAPH_MAX_ASK_USD`, or today's asks would pass `TELEGRAPH_DAILY_LIMIT_USD`. Nothing was signed or paid. Raise the limit in the server's settings, or wait for the next UTC day.
|
|
34
|
+
|
|
35
|
+
## 402 after paying by x402 (x402 turned on)
|
|
36
|
+
|
|
37
|
+
The wallet may lack USDC, or the payment was refused. `telegraph_account` shows the wallet balance.
|
|
38
|
+
|
|
39
|
+
## 500 or 502 after payment
|
|
40
|
+
|
|
41
|
+
The miner failed. On escrow nothing is billed. An x402 payment is credited to your escrow, so it stays yours.
|
|
42
|
+
|
|
43
|
+
## Paying needs a wallet
|
|
44
|
+
|
|
45
|
+
The server found no wallet. The user runs `npx -y @telegraphprotocol/telegraph-protocol-mcp setup`, then restarts the agent app.
|
package/package.json
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@telegraphprotocol/telegraph-protocol-mcp",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "MCP server for the Telegraph network: ask ranked miners (prices, FX, weather, search, security, code review and 100+ intents), browse intents, miners and rankings, and pay from escrow or by x402 in USDC",
|
|
5
|
-
"mcpName": "io.github.telegraphprotocol/telegraph",
|
|
6
|
-
"main": "dist/index.js",
|
|
7
|
-
"bin": {
|
|
8
|
-
"telegraph-protocol-mcp": "dist/index.js"
|
|
9
|
-
},
|
|
10
|
-
"type": "module",
|
|
11
|
-
"license": "MIT",
|
|
12
|
-
"homepage": "https://github.com/telegraphprotocol/telegraph-mcp#readme",
|
|
13
|
-
"repository": {
|
|
14
|
-
"type": "git",
|
|
15
|
-
"url": "git+https://github.com/telegraphprotocol/telegraph-mcp.git"
|
|
16
|
-
},
|
|
17
|
-
"bugs": {
|
|
18
|
-
"url": "https://github.com/telegraphprotocol/telegraph-mcp/issues"
|
|
19
|
-
},
|
|
20
|
-
"keywords": [
|
|
21
|
-
"mcp",
|
|
22
|
-
"model-context-protocol",
|
|
23
|
-
"telegraph",
|
|
24
|
-
"ai-agents",
|
|
25
|
-
"x402",
|
|
26
|
-
"escrow",
|
|
27
|
-
"usdc",
|
|
28
|
-
"agent-payments",
|
|
29
|
-
"miners",
|
|
30
|
-
"ranking",
|
|
31
|
-
"web3"
|
|
32
|
-
],
|
|
33
|
-
"files": [
|
|
34
|
-
"dist",
|
|
35
|
-
"guides",
|
|
36
|
-
"README.md",
|
|
37
|
-
".agents"
|
|
38
|
-
],
|
|
39
|
-
"engines": {
|
|
40
|
-
"node": ">=20"
|
|
41
|
-
},
|
|
42
|
-
"scripts": {
|
|
43
|
-
"build": "tsc",
|
|
44
|
-
"start": "node dist/index.js",
|
|
45
|
-
"dev": "tsx src/index.ts",
|
|
46
|
-
"inspect": "npx @modelcontextprotocol/inspector dist/index.js",
|
|
47
|
-
"prepublishOnly": "npm run build",
|
|
48
|
-
"test": "npm run build && node --test test/*.test.mjs"
|
|
49
|
-
},
|
|
50
|
-
"dependencies": {
|
|
51
|
-
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
52
|
-
"@x402/fetch": "^2.11.0",
|
|
53
|
-
"@x402/evm": "^2.11.0",
|
|
54
|
-
"@x402/core": "^2.11.0",
|
|
55
|
-
"viem": "^2.21.0",
|
|
56
|
-
"zod": "^3.25.0"
|
|
57
|
-
},
|
|
58
|
-
"devDependencies": {
|
|
59
|
-
"typescript": "^5.7.0",
|
|
60
|
-
"@types/node": "^22.0.0",
|
|
61
|
-
"tsx": "^4.19.0"
|
|
62
|
-
}
|
|
63
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@telegraphprotocol/telegraph-protocol-mcp",
|
|
3
|
+
"version": "2.3.0",
|
|
4
|
+
"description": "MCP server for the Telegraph network: ask ranked miners (prices, FX, weather, search, security, code review and 100+ intents), browse intents, miners and rankings, and pay from escrow or by x402 in USDC",
|
|
5
|
+
"mcpName": "io.github.telegraphprotocol/telegraph",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"telegraph-protocol-mcp": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"type": "module",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"homepage": "https://github.com/telegraphprotocol/telegraph-mcp#readme",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/telegraphprotocol/telegraph-mcp.git"
|
|
16
|
+
},
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/telegraphprotocol/telegraph-mcp/issues"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"mcp",
|
|
22
|
+
"model-context-protocol",
|
|
23
|
+
"telegraph",
|
|
24
|
+
"ai-agents",
|
|
25
|
+
"x402",
|
|
26
|
+
"escrow",
|
|
27
|
+
"usdc",
|
|
28
|
+
"agent-payments",
|
|
29
|
+
"miners",
|
|
30
|
+
"ranking",
|
|
31
|
+
"web3"
|
|
32
|
+
],
|
|
33
|
+
"files": [
|
|
34
|
+
"dist",
|
|
35
|
+
"guides",
|
|
36
|
+
"README.md",
|
|
37
|
+
".agents"
|
|
38
|
+
],
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=20"
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"build": "tsc",
|
|
44
|
+
"start": "node dist/index.js",
|
|
45
|
+
"dev": "tsx src/index.ts",
|
|
46
|
+
"inspect": "npx @modelcontextprotocol/inspector dist/index.js",
|
|
47
|
+
"prepublishOnly": "npm run build",
|
|
48
|
+
"test": "npm run build && node --test test/*.test.mjs"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
52
|
+
"@x402/fetch": "^2.11.0",
|
|
53
|
+
"@x402/evm": "^2.11.0",
|
|
54
|
+
"@x402/core": "^2.11.0",
|
|
55
|
+
"viem": "^2.21.0",
|
|
56
|
+
"zod": "^3.25.0"
|
|
57
|
+
},
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"typescript": "^5.7.0",
|
|
60
|
+
"@types/node": "^22.0.0",
|
|
61
|
+
"tsx": "^4.19.0"
|
|
62
|
+
}
|
|
63
|
+
}
|