feat(mcp): add describe_tools and annotate_tool functionality
* Implement DescribeTool for listing available MCP tools with annotations. * Add UpsertToolAnnotation and GetToolAnnotations methods for managing tool notes. * Create tool_annotations table for storing tool usage notes.
This commit is contained in:
@@ -18,9 +18,15 @@ Use AMCS as memory with two scopes:
|
||||
6. If no strong project match exists, you may use global notebook memory with no project.
|
||||
7. If multiple projects plausibly match, ask the user before reading or writing project memory.
|
||||
|
||||
## Session Startup
|
||||
|
||||
At the very start of any session with AMCS:
|
||||
|
||||
1. Call `describe_tools` to get the full list of available tools with their categories and any notes you have previously annotated. Read the notes before using a tool — they contain accumulated gotchas, workflow patterns, and field-ordering requirements you have recorded from prior sessions.
|
||||
|
||||
## Project Session Startup
|
||||
|
||||
At the start of every project session, after setting the active project:
|
||||
After setting the active project:
|
||||
|
||||
1. Call `list_project_skills` to load any saved agent behaviour instructions for the project.
|
||||
2. Call `list_project_guardrails` to load any saved agent constraints for the project.
|
||||
@@ -59,6 +65,16 @@ At the start of every project session, after setting the active project:
|
||||
- Do not base64-encode a file to pass it to `save_file` if an `amcs://files/{id}` URI is already available from a prior `upload_file` or HTTP upload.
|
||||
- When saving, choose the narrowest correct scope: project if project-specific, global if not.
|
||||
|
||||
## Tool Annotations
|
||||
|
||||
As you learn non-obvious behaviours, gotchas, or workflow patterns for individual tools, persist them with `annotate_tool`:
|
||||
|
||||
```json
|
||||
{ "tool_name": "capture_thought", "notes": "Always pass project explicitly — session state is unreliable in this client." }
|
||||
```
|
||||
|
||||
Notes are returned by `describe_tools` in future sessions. Annotate whenever you discover something worth remembering: a required field combination, a parameter that behaves unexpectedly, or a preferred call sequence. Pass an empty string to clear a note.
|
||||
|
||||
## Skills and Guardrails
|
||||
|
||||
- **Skills** are reusable agent behaviour instructions (e.g. output formatting rules, reasoning strategies, workflow conventions).
|
||||
@@ -69,4 +85,4 @@ At the start of every project session, after setting the active project:
|
||||
|
||||
## Short Operational Form
|
||||
|
||||
Use AMCS memory in project scope when the current work matches a known project. If no clear project matches, global notebook memory is allowed for non-project-specific information. At the start of every project session call `list_project_skills` and `list_project_guardrails` and apply what is returned; only create new skills or guardrails if none exist. If your MCP client does not preserve sessions across calls, pass `project` explicitly instead of relying on `set_active_project`. Store durable notes with `capture_thought`. For binary files or files larger than 10 MB, call `upload_file` with `content_path` to stage the file and get an `amcs://files/{id}` URI, then pass that URI to `save_file` as `content_uri` to link it to a thought. For small files, use `save_file` or `upload_file` with `content_base64` directly. Browse stored files with `list_files`, and load them with `load_file` only when their contents are needed. Stored files can also be read as raw binary via MCP resources at `amcs://files/{id}`. Never store project-specific memory globally when a matching project exists, and never store memory in the wrong project. If project matching is ambiguous, ask the user.
|
||||
At the start of every session, call `describe_tools` to read the full tool list and any accumulated usage notes. Use AMCS memory in project scope when the current work matches a known project; if no clear project matches, global notebook memory is allowed for non-project-specific information. At the start of every project session call `list_project_skills` and `list_project_guardrails` and apply what is returned; only create new skills or guardrails if none exist. If your MCP client does not preserve sessions across calls, pass `project` explicitly instead of relying on `set_active_project`. Store durable notes with `capture_thought`. For binary files or files larger than 10 MB, call `upload_file` with `content_path` to stage the file and get an `amcs://files/{id}` URI, then pass that URI to `save_file` as `content_uri` to link it to a thought. For small files, use `save_file` or `upload_file` with `content_base64` directly. Browse stored files with `list_files`, and load them with `load_file` only when their contents are needed. Stored files can also be read as raw binary via MCP resources at `amcs://files/{id}`. Never store project-specific memory globally when a matching project exists, and never store memory in the wrong project. If project matching is ambiguous, ask the user. Whenever you discover a non-obvious tool behaviour, gotcha, or workflow pattern, record it with `annotate_tool` so future sessions benefit.
|
||||
|
||||
Reference in New Issue
Block a user