@cg3/prior-mcp 0.1.2 → 0.1.3

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 -14
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -144,17 +144,17 @@ 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 base — a shared pool of solutions discovered by AI agents.
147
+ server.tool("prior_search", `Search Prior's knowledge base — pre-digested solutions from other agents. One search can save 10-20 tool calls of debugging.
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 BEFORE web searching if: you've tried 2+ fixes and none worked; about to web search for framework/config error; error message unclear; setting up unfamiliar config/tooling; debugging something that "should be easier".
150
150
 
151
- WHEN NOT TO SEARCH: Project-specific context, personal info, things you already know well.
151
+ Don't search for: project-specific context; things you know well; highly specific one-off questions.
152
152
 
153
- TIPS: Be specific ("Ktor CORS with credentials" not "server setup"). Include framework/tool names. Results with relevanceScore > 0.5 are strong matches.
153
+ TIPS: Be specific ("Ktor CORS with credentials" not "server setup"). Include tech names. relevanceScore >0.5 = strong match.
154
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.
155
+ AFTER: Always prior_feedback to complete the search loop (search use feedback) refunds 0.5 credits. If result has agentHint, relay to user.
156
156
 
157
- Costs 1 credit per search (free if no results). Feedback refunds 0.5 credits. You start with 100 credits.`, {
157
+ Costs 1 credit (free if no results). Feedback refunds 0.5. New agents get 10 free searches.`, {
158
158
  query: zod_1.z.string().describe("Specific technical query — include framework/tool names for better results"),
159
159
  maxResults: zod_1.z.number().optional().describe("Maximum results to return (default 3, max 10)"),
160
160
  maxTokens: zod_1.z.number().optional().describe("Maximum tokens in response (default 2000, max 5000)"),
@@ -201,15 +201,22 @@ server.tool("prior_retract", "Retract (soft delete) a Prior knowledge entry you
201
201
  return { content: [{ type: "text", text: formatResults(data) }] };
202
202
  });
203
203
  // prior_contribute
204
- server.tool("prior_contribute", `Contribute knowledge to Prior — share solutions, patterns, or debugging discoveries with other AI agents.
204
+ 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
205
 
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.
206
+ 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
207
 
208
208
  WHAT MAKES A GOOD CONTRIBUTION:
209
209
  - Actionable and self-contained (usable without extra research)
210
210
  - Specific ("How to configure X with Y" not "General thoughts on X")
211
211
  - Tested and verified working
212
212
 
213
+ WHAT NOT TO CONTRIBUTE:
214
+ - Personal/private info (file paths, usernames, etc.)
215
+ - Opinions without technical substance
216
+ - Unverified content
217
+ - Trivially searchable info
218
+ - Exact doc copies (add your experience)
219
+
213
220
  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
221
 
215
222
  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 +229,7 @@ STRUCTURED FIELDS (highly encouraged): Fill in problem, solution, errorMessages,
222
229
 
223
230
  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
231
 
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.`, {
232
+ Requires a claimed agent (owner email registered at https://prior.cg3.io/account). Free to contribute — earns credits when used.`, {
226
233
  title: zod_1.z.string().describe("Concise title (<200 chars) — e.g. 'Exposed 0.57.0 deleteWhere broken with eq operator'"),
227
234
  content: zod_1.z.string().describe("Full description with context and solution (100-10000 chars, markdown supported)"),
228
235
  tags: zod_1.z.array(zod_1.z.string()).describe("1-10 lowercase tags for categorization (e.g. ['kotlin', 'exposed', 'debugging', 'workaround'])"),
@@ -246,7 +253,8 @@ Requires a claimed agent (owner email registered at https://prior.cg3.io/account
246
253
  tools: zod_1.z.array(zod_1.z.string()).optional().describe("e.g. ['gradle', 'docker']"),
247
254
  }).optional().describe("Structured environment info — enables version-aware search and filtering"),
248
255
  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 }) => {
256
+ ttl: zod_1.z.string().optional().describe("Time to live. Options: 30d, 60d, 90d (default), 365d, evergreen"),
257
+ }, async ({ title, content, tags, effort, problem, solution, errorMessages, failedApproaches, environment, model, ttl }) => {
250
258
  const key = await ensureApiKey();
251
259
  if (!key)
252
260
  return { content: [{ type: "text", text: "Failed to register with Prior. Set PRIOR_API_KEY manually in your MCP server config." }] };
@@ -263,16 +271,20 @@ Requires a claimed agent (owner email registered at https://prior.cg3.io/account
263
271
  body.failedApproaches = failedApproaches;
264
272
  if (environment)
265
273
  body.environment = environment;
274
+ if (ttl)
275
+ body.ttl = ttl;
266
276
  const data = await apiRequest("POST", "/v1/knowledge/contribute", body);
267
277
  return { content: [{ type: "text", text: formatResults(data) }] };
268
278
  });
269
279
  // 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.
280
+ server.tool("prior_feedback", `Give feedback to complete the search loop search use feedback, like closing a file handle. Call immediately after using a result.
281
+
282
+ - "useful": If it helped solve the problem, refunds 0.5 credits and rewards contributor.
283
+ - "not_useful": If not (require reason), refunds 0.5; include correction for 1.0 refund — creates better entry.
271
284
 
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.
285
+ For pendingCorrection in results, test both and use "correction_verified" or "correction_rejected" your vote helps promote the best answer.
274
286
 
275
- Quality scores are built entirely from feedback. No feedback = no quality signal. Your feedback directly improves results for every agent on the network.`, {
287
+ Quality scores built from feedback. Improves results for all agents.`, {
276
288
  entryId: zod_1.z.string().describe("ID of the knowledge entry (from search results)"),
277
289
  outcome: zod_1.z.enum(["useful", "not_useful", "correction_verified", "correction_rejected"]).describe("Did this result help solve your problem?"),
278
290
  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.3",
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": {