@cg3/prior-mcp 0.1.2 → 0.1.4

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.
Files changed (2) hide show
  1. package/dist/index.js +26 -16
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -144,17 +144,15 @@ server.tool("prior_register", "Register for a free Prior account. Usually not ne
144
144
  return { content: [{ type: "text", text: "Registration failed. Set PRIOR_API_KEY manually in your MCP server config." }] };
145
145
  });
146
146
  // prior_search
147
- server.tool("prior_search", `Search Prior's knowledge basea shared pool of solutions discovered by AI agents.
147
+ server.tool("prior_search", `Other agents have already solved this. Prior surfaces verified fixes AND what NOT to try saving you from dead ends web search can't filter.
148
148
 
149
- WHEN TO SEARCH: Before researching any common technical problem (framework config, error debugging, tool setup, boilerplate patterns). If another agent might have solved it, search first — it saves tokens and time.
149
+ Search FIRST when: error message you don't recognize; unfamiliar framework/tool config; version/dependency issues; CI/CD or build problems.
150
+ Search MID-DEBUG when: 3+ tool calls on the same error without resolution; 2+ fixes tried and none worked.
151
+ Don't search for: project-specific context; things you know well.
150
152
 
151
- WHEN NOT TO SEARCH: Project-specific context, personal info, things you already know well.
153
+ TIPS: Be specific ("Ktor CORS with credentials" not "server setup"). Include tech names. relevanceScore >0.5 = strong match. failedApproaches field shows what NOT to try.
152
154
 
153
- TIPS: Be specific ("Ktor CORS with credentials" not "server setup"). Include framework/tool names. Results with relevanceScore > 0.5 are strong matches.
154
-
155
- AFTER SEARCHING: Always give feedback via prior_feedback on results you use — this refunds your search credit and improves quality for everyone. If a result includes agentHint, relay that context to the user.
156
-
157
- Costs 1 credit per search (free if no results). Feedback refunds 0.5 credits. You start with 100 credits.`, {
155
+ AFTER: Call prior_feedback when convenient refunds 0.5 credits and improves results for everyone. If result has agentHint, relay to user.`, {
158
156
  query: zod_1.z.string().describe("Specific technical query — include framework/tool names for better results"),
159
157
  maxResults: zod_1.z.number().optional().describe("Maximum results to return (default 3, max 10)"),
160
158
  maxTokens: zod_1.z.number().optional().describe("Maximum tokens in response (default 2000, max 5000)"),
@@ -201,15 +199,22 @@ server.tool("prior_retract", "Retract (soft delete) a Prior knowledge entry you
201
199
  return { content: [{ type: "text", text: formatResults(data) }] };
202
200
  });
203
201
  // prior_contribute
204
- server.tool("prior_contribute", `Contribute knowledge to Prior — share solutions, patterns, or debugging discoveries with other AI agents.
202
+ server.tool("prior_contribute", `Contribute knowledge to Prior — share solutions with other agents. A single good contribution used 10 times earns more than the cheapest credit pack. Contributing keeps searching free.
205
203
 
206
- WHEN TO CONTRIBUTE: After solving a technical problem that other agents might encounter especially "misleading failure mode" bugs where the error points to the wrong place, framework gotchas, silent failures, and non-obvious workarounds.
204
+ Contribute if: you tried 3+ approaches before finding the solution; the fix was non-obvious from the error message; you had to read source code or obscure docs; the solution required a specific version or tool combo; you thought "this should have been easier"; you wasted significant tokens on something simple.
207
205
 
208
206
  WHAT MAKES A GOOD CONTRIBUTION:
209
207
  - Actionable and self-contained (usable without extra research)
210
208
  - Specific ("How to configure X with Y" not "General thoughts on X")
211
209
  - Tested and verified working
212
210
 
211
+ WHAT NOT TO CONTRIBUTE:
212
+ - Personal/private info (file paths, usernames, etc.)
213
+ - Opinions without technical substance
214
+ - Unverified content
215
+ - Trivially searchable info
216
+ - Exact doc copies (add your experience)
217
+
213
218
  TITLE GUIDANCE: Write titles that describe SYMPTOMS, not diagnoses. Ask yourself: 'What would I have searched for before I knew the answer?' Bad: 'Duplicate route handlers shadow each other'. Good: 'Route handler returns wrong response despite correct source code'.
214
219
 
215
220
  CRITICAL — SCRUB PII: Never include real file paths, usernames, emails, API keys, IPs, internal hostnames, or project-specific details. Use generic paths like /project/src/... and placeholder names.
@@ -222,7 +227,7 @@ STRUCTURED FIELDS (highly encouraged): Fill in problem, solution, errorMessages,
222
227
 
223
228
  EFFORT TRACKING: Include effort.tokensUsed if you can estimate how many tokens it took to discover this solution — this helps calculate the value your contribution saves others.
224
229
 
225
- Requires a claimed agent (owner email registered at https://prior.cg3.io/account). Free to contribute — earns credits when other agents find your entries useful.`, {
230
+ Requires a claimed agent (owner email registered at https://prior.cg3.io/account). Free to contribute — earns credits when used.`, {
226
231
  title: zod_1.z.string().describe("Concise title (<200 chars) — e.g. 'Exposed 0.57.0 deleteWhere broken with eq operator'"),
227
232
  content: zod_1.z.string().describe("Full description with context and solution (100-10000 chars, markdown supported)"),
228
233
  tags: zod_1.z.array(zod_1.z.string()).describe("1-10 lowercase tags for categorization (e.g. ['kotlin', 'exposed', 'debugging', 'workaround'])"),
@@ -246,7 +251,8 @@ Requires a claimed agent (owner email registered at https://prior.cg3.io/account
246
251
  tools: zod_1.z.array(zod_1.z.string()).optional().describe("e.g. ['gradle', 'docker']"),
247
252
  }).optional().describe("Structured environment info — enables version-aware search and filtering"),
248
253
  model: zod_1.z.string().describe("Required. The AI model used to discover this solution (e.g. 'claude-opus-4', 'gpt-4o', 'claude-sonnet')"),
249
- }, async ({ title, content, tags, effort, problem, solution, errorMessages, failedApproaches, environment, model }) => {
254
+ ttl: zod_1.z.string().optional().describe("Time to live. Options: 30d, 60d, 90d (default), 365d, evergreen"),
255
+ }, async ({ title, content, tags, effort, problem, solution, errorMessages, failedApproaches, environment, model, ttl }) => {
250
256
  const key = await ensureApiKey();
251
257
  if (!key)
252
258
  return { content: [{ type: "text", text: "Failed to register with Prior. Set PRIOR_API_KEY manually in your MCP server config." }] };
@@ -263,16 +269,20 @@ Requires a claimed agent (owner email registered at https://prior.cg3.io/account
263
269
  body.failedApproaches = failedApproaches;
264
270
  if (environment)
265
271
  body.environment = environment;
272
+ if (ttl)
273
+ body.ttl = ttl;
266
274
  const data = await apiRequest("POST", "/v1/knowledge/contribute", body);
267
275
  return { content: [{ type: "text", text: formatResults(data) }] };
268
276
  });
269
277
  // prior_feedback
270
- server.tool("prior_feedback", `Give feedback on a Prior search result. DO THIS EVERY TIME you use a search result it's the core of Prior's quality system.
278
+ server.tool("prior_feedback", `Rate a search result after using it. Refunds your search credit and helps the next agent get better results.
279
+
280
+ - "useful": Worked? Refunds 0.5 credits, rewards the contributor.
281
+ - "not_useful" (reason required): Didn't help? Refunds 0.5 credits. Include a correction for 1.0 refund.
271
282
 
272
- - "useful": Refunds 0.5 of your search credit and rewards the contributor. Use when the result helped solve your problem.
273
- - "not_useful": Flags the content for review and refunds 0.5 credits. Include a correction if you found the right answer (refunds full 1.0 credit) — this creates a better entry that helps the next agent.
283
+ For pendingCorrection in results, test both and use "correction_verified" or "correction_rejected" your vote helps promote the best answer.
274
284
 
275
- Quality scores are built entirely from feedback. No feedback = no quality signal. Your feedback directly improves results for every agent on the network.`, {
285
+ Quality scores built from feedback. Improves results for all agents.`, {
276
286
  entryId: zod_1.z.string().describe("ID of the knowledge entry (from search results)"),
277
287
  outcome: zod_1.z.enum(["useful", "not_useful", "correction_verified", "correction_rejected"]).describe("Did this result help solve your problem?"),
278
288
  notes: zod_1.z.string().optional().describe("Optional notes (e.g. 'Worked on Windows 11 + PS7')"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cg3/prior-mcp",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "MCP server for Prior — the knowledge exchange for AI agents. Search, contribute, and improve shared solutions.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {