Skip to main content
Glama
LZMW

Aurai Advisor (上级顾问 MCP)

by LZMW

sync_context

Upload .md or .txt files to provide project context to the senior AI advisor, ensuring complete content delivery without truncation.

Instructions

同步代码上下文(支持上传 .md 和 .txt 文件,避免内容被截断)

在第一次调用或上下文发生重大变化时使用,让上级AI了解当前项目的整体情况。


🎯 典型使用场景

场景 1:上传文章供上级顾问评审

sync_context(
    operation='full_sync',
    files=['文章.md'],
    project_info={
        'task': 'article_review',
        'target_platform': 'GLM Coding 知识库'
    }
)
consult_aurai(
    problem_type='other',
    error_message='请评审以下投稿文章...',
    context={'请查看已上传的文章文件': '已通过 sync_context 上传'}
)

场景 2:上传代码文件(避免内容被截断)⭐ 重要

# 问题:代码太长,在 context 字段中可能被截断
# 解决:将代码转换为 .txt 文件后上传

import shutil

# 步骤 1:将代码文件复制为 .txt
shutil.copy('src/main.py', 'src/main.txt')

# 步骤 2:上传文件
sync_context(
    operation='incremental',
    files=['src/main.txt'],
    project_info={
        'description': '需要调试的代码',
        'language': 'Python'
    }
)

# 步骤 3:告诉上级顾问文件已上传
consult_aurai(
    problem_type='runtime_error',
    error_message='请审查已上传的 src/main.txt 文件,帮我找出bug',
    context={
        'file_location': '已通过 sync_context 上传',
        'expected_behavior': '应该输出...',
        'actual_behavior': '实际输出...'
    }
)

优势

  • ✅ 避免代码在 contextanswers_to_questions 字段中被截断

  • ✅ 利用 sync_context 的文件读取机制,完整传递内容

  • ✅ 上级顾问可以完整读取代码文件

场景 3:项目首次初始化

sync_context(
    operation='full_sync',
    files=['README.md', 'docs/说明文档.md'],
    project_info={
        'project_name': 'My Project',
        'tech_stack': 'Python + FastAPI'
    }
)

[注意] 文件上传限制

files 参数只支持 .txt 和 .md 文件!

  • [OK] 支持:README.md, docs.txt, notes.md 等文本和Markdown文件

  • [X] 不支持:.py, .js, .json, .yaml 等代码文件

使用场景

  1. full_sync: 完整同步,适合首次调用或项目重大变更

  2. incremental: 增量同步,适合添加新文件或更新

  3. clear: 清空对话历史

Token优化

当 project_info 中的单个字段超过 800 tokens 时,会自动:

  • 缓存到临时文件

  • 在对话历史中记录文件路径

  • 发送给上级AI时仍会读取完整内容

参数说明

  • operation: 操作类型(full_sync/incremental/clear)

  • files: 文件路径列表,只能是 .txt 或 .md 文件

  • project_info: 项目信息字典,可包含任意字段

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
operationYes操作类型: full_sync(完整同步), incremental(增量添加), clear(清空历史)
filesNo**⚠️ 只支持 .txt 和 .md 文件!** 如需上传代码文件(.py/.js/.json等),必须先复制为 .txt。示例: shutil.copy('script.py', 'script.txt') 然后传 files=['script.txt']。文件路径列表(支持 JSON 字符串或列表,会自动解析)
project_infoNo项目信息字典,可包含项目名称、技术栈、任务描述等任意字段(支持 JSON 字符串或字典,会自动解析)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behaviors: file type restrictions (.txt and .md only), token optimization (caching for fields >800 tokens), and the three operation modes (full_sync, incremental, clear) with their purposes. However, it doesn't mention potential side effects like whether files are stored persistently, if there are rate limits, or authentication requirements, leaving some gaps for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with sections for typical scenarios, notes, and parameter explanations, but it is overly verbose. The extensive code examples and scenario details could be condensed; not every sentence earns its place as some repetition occurs (e.g., file restrictions mentioned multiple times). It's front-loaded with the core purpose, but the length may reduce scanability.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (mutation with file handling) and rich schema (100% coverage, output schema exists), the description is highly complete. It covers purpose, usage guidelines, behavioral traits, parameter semantics with examples, and operational details. The output schema handles return values, so the description appropriately focuses on input and behavior, leaving no significant gaps for agent understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters. The description adds significant value beyond the schema by explaining the rationale behind file restrictions (to avoid truncation), providing concrete usage examples with code snippets, and detailing token optimization behavior. However, it doesn't fully explain the semantics of 'project_info' beyond stating it can contain arbitrary fields, missing guidance on typical or required fields.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: '同步代码上下文(支持上传 .md 和 .txt 文件,避免内容被截断)' - to sync code context by uploading .md and .txt files to avoid truncation. It specifies the verb (sync/upload), resource (code context via files), and distinguishes from siblings by focusing on file-based context management rather than consultation, status checking, or progress reporting.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool: '在第一次调用或上下文发生重大变化时使用' (use on first call or when context changes significantly). It includes detailed scenarios (article review, code upload, project initialization) with concrete examples and contrasts with alternatives by noting that code should be uploaded here instead of placed in 'context' or 'answers_to_questions' fields of other tools to avoid truncation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/LZMW/mcp-aurai-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server