tokens-for-good 0.2.7 → 0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tokens-for-good",
3
- "version": "0.2.7",
3
+ "version": "0.3.0",
4
4
  "type": "module",
5
5
  "description": "Donate your spare AI tokens to research nonprofits for Fierce Philanthropy",
6
6
  "bin": {
package/src/mcp-server.js CHANGED
@@ -26,7 +26,7 @@ updateState({ platform });
26
26
 
27
27
  const server = new McpServer({
28
28
  name: 'tokens-for-good',
29
- version: '0.2.7',
29
+ version: '0.3.0',
30
30
  });
31
31
 
32
32
  // --- No-key onboarding message ---
package/src/platform.js CHANGED
@@ -22,116 +22,19 @@ export function isSchedulable(platform) {
22
22
  }
23
23
 
24
24
  export function getSchedulePrompt(apiKey) {
25
- return `You are a research agent for Fierce Philanthropy's Tokens for Good program. Your job is to claim a nonprofit org, research it thoroughly, and submit a report.
25
+ const base = 'https://fierce-philanthropy-directory.laravel.cloud/api';
26
+ return `You are a research agent for Fierce Philanthropy's Tokens for Good program.
26
27
 
27
- ## API Access
28
+ ## Setup
29
+ API Base: ${base}
30
+ Auth header for all requests: X-TFG-Api-Key: ${apiKey}
28
31
 
29
- Base URL: https://fierce-philanthropy-directory.laravel.cloud/api
30
- Auth header: X-TFG-Api-Key: ${apiKey}
32
+ ## Instructions
33
+ 1. Fetch the batch flow: WebFetch GET ${base}/research/schedule-instructions
34
+ 2. Fetch the research methodology: WebFetch GET ${base}/research/methodology?step=research
35
+ 3. Follow the batch flow instructions, using the methodology to research each org.
31
36
 
32
- ## Steps
33
-
34
- ### 1. Claim an org
35
- Use WebFetch to POST to /api/research/claim:
36
-
37
- WebFetch URL: https://fierce-philanthropy-directory.laravel.cloud/api/research/claim
38
- Method: POST
39
- Headers: X-TFG-Api-Key: ${apiKey}, Content-Type: application/json
40
- Body: {"platform": "claude-code-scheduled"}
41
-
42
- This returns the org name, URL, description, and a claim_id. You have 30 minutes.
43
-
44
- ### 2. Research the org
45
- Use WebSearch and WebFetch to thoroughly research the organization:
46
- - The org's website, impact pages, annual reports
47
- - Independent evaluations (RCTs, J-PAL, 3ie)
48
- - Third-party reviews (GiveWell, Charity Navigator)
49
- - Financial data (ProPublica Nonprofit Explorer)
50
-
51
- ### 3. Write the report
52
- Follow the Fierce Philanthropy research methodology:
53
-
54
- **PROMPT 1** - Org and Social Problem Summary (problem, population, location)
55
- **PROMPT 2** - Top 20 Negative Consequences table
56
- **PROMPT 3** - Classify each as Intermediary or Ultimate Outcome
57
- **PROMPT 4** - Positive Results shared by the org (with citations)
58
- **PROMPT 5** - Counterfactual Results (with citations)
59
-
60
- **SUMMARY REPORT** with 7 sections:
61
- 1. Our Recommendation (with scored checklist)
62
- 2. The Social Problem
63
- 3. The Solution
64
- 4. Key Outputs
65
- 5. Key Intermediate Outcomes
66
- 6. Key Ultimate Outcomes
67
- 7. Continual Learning & Adaptation
68
-
69
- **SOURCES** - All cited sources with full URLs
70
-
71
- #### Scoring Checklist (use EXACTLY these criteria):
72
-
73
- Base score (out of 100):
74
- - [x] or [ ] a. Has Ultimate Outcome Goals (50 pts)
75
- - [x] or [ ] b. Measures Intermediate Outcomes (10 pts)
76
- - [x] or [ ] c. Measures Ultimate Outcomes (15 pts)
77
- - [x] or [ ] d. Shows Continual Learning & Adaptation (25 pts)
78
-
79
- Extra credit:
80
- - [x] or [ ] e. Measures Intermediate Counterfactual (10 pts)
81
- - [x] or [ ] f. Measures Ultimate Counterfactual (10 pts)
82
-
83
- **Score: [X]/100** (can exceed 100 with extra credit, max 120)
84
-
85
- ### 4. Submit the report
86
- Use WebFetch to POST to /api/research/submit:
87
-
88
- WebFetch URL: https://fierce-philanthropy-directory.laravel.cloud/api/research/submit
89
- Method: POST
90
- Headers: X-TFG-Api-Key: ${apiKey}, Content-Type: application/json
91
- Body: {"claim_id": <claim_id from step 1>, "report_markdown": "<full report>", "model_used": "claude-code-scheduled", "token_usage": {"total_tokens": <estimated total tokens used>}}
92
-
93
- Estimate tokens: count your web searches (~1K each), web fetches (~2-5K each), report output (~4 tokens/word), plus ~10K for system/tool overhead.
94
-
95
- ### 5. Check next-action
96
- After submitting, check if you need to do a peer review before continuing:
97
-
98
- WebFetch URL: https://fierce-philanthropy-directory.laravel.cloud/api/research/next-action
99
- Method: GET
100
- Headers: X-TFG-Api-Key: ${apiKey}, Accept: application/json
101
-
102
- If the response says action is "review", do the review:
103
-
104
- **5a. Get the review:**
105
- WebFetch URL: https://fierce-philanthropy-directory.laravel.cloud/api/research/review/next
106
- Method: GET
107
- Headers: X-TFG-Api-Key: ${apiKey}, Accept: application/json
108
-
109
- **5b. Review the report** — score it 1-4 (4=great, 3=good with minor fixes, 2=needs redo, 1=bad actor)
110
-
111
- **5c. Submit the review:**
112
- WebFetch URL: https://fierce-philanthropy-directory.laravel.cloud/api/research/review/submit
113
- Method: POST
114
- Headers: X-TFG-Api-Key: ${apiKey}, Content-Type: application/json
115
- Body: {"claim_id": <claim_id>, "score": <1-4>, "notes": "<review notes>", "updated_report": "<fixed report if score is 3>"}
116
-
117
- ### 6. Repeat (up to 3 orgs per session)
118
- After completing each org (and any peer review), loop back to Step 1 and claim the next org.
119
- Research up to 3 orgs total per session. After 3 orgs (or if no more are available), stop.
120
-
121
- ## Batch Flow Summary
122
- \`\`\`
123
- for i in 1..3:
124
- claim org → research → submit report
125
- check next-action → if review needed, do review
126
- repeat
127
- \`\`\`
128
-
129
- ### Rules
130
- - Every factual claim needs an inline citation [Source Name](URL)
131
- - Only use direct results from the org, not from similar orgs
132
- - No anecdotes, only measured results
133
- - Paragraphs under 4 sentences
134
- - No em dashes, no filler adjectives, no AI tells`;
37
+ All endpoints, scoring criteria, and submission format are in the fetched instructions.`;
135
38
  }
136
39
 
137
40
  export function getAutomationInstructions(platform, frequency = 'daily', apiKey = null) {