Files
Liti-agent-Development/Global_Rules.md
T

3.2 KiB

Global Rules on Tools & Error Handling (Mandatory)

1. MCP tools you may use

(localdocs)

  • read_doc(doc_name: str) -> str:

    • description: Read content from a document in the localdocs directory.
  • write_file(path: str, content: str, overwrite: bool = True) -> str:

    • description: Write content to a file in the localdocs directory.
  • delete_file(path: str) -> str:

    • description: Delete a file from the localdocs directory.
  • read_binary_doc(doc_name: str) -> str:

    • description: Read a binary file (PDF, image, etc.) from the localdocs directory as base64.
  • list_docs(pattern: str = "*", path: str = "", recursive: bool = False) -> str:

    • description: List all documents in the localdocs directory.
  • list_folders(path: str = "", recursive: bool = False) -> str:

    • description: List all folders in the localdocs directory.
  • create_folder(path: str) -> str:

    • description: Create a new folder in the localdocs directory.
  • delete_folder(path: str, force: bool = False) -> str:

    • description: Delete a folder from the localdocs directory.
  • copy_item(source: str, destination: str) -> str:

    • description: Copy a file or folder within the localdocs directory.
  • delete_file(path: str) -> str:

    • description: Delete a file from the localdocs directory.

(weaviate)

  • list_collections() -> List[str]:
    • description: List all collections in the Weaviate instance.
  • list_tenants(collection_name: str) -> List[str]:
    • description: List all tenants in a specific collection.
  • search_hybrid(collection_name, query, alpha, vector, query_properties, fusion_type, limit, offset, bm25_operator, bm25_minimum_match, auto_limit, filters, group_by, rerank_query, rerank_property, target_vector, include_vector, tenant)
    • description: Perform a hybrid search on a collection
  • search_bm25(collection_name: str, query: str, limit: int = 10, tenant: Optional[str] = None) -> List[dict]:
    • description: Perform a BM25 (keyword) search on a collection.

(redis)

  • read_file(path: str) -> str:
    • description: Read content from a file stored in Redis.
  • read_doc(path: str) -> str:
    • description: Read document content from Redis (alias for read_file).
  • write_file(path: str, content: str, overwrite: bool = True) -> str:
    • description: Write content to a file in Redis.
  • list_files(pattern: str = "*") -> str:
    • description: List all files stored in Redis.
  • delete_file(path: str) -> str:
    • description: Delete a file from Redis.

(outsourcing)

  • run_dag(execution_name, task_procedure, tasks, system_prompt, tools)
  • get_execution_result(execution_id)
  • check_execution_status(execution_id)
  • get_execution_logs(execution_id, tail=200)

2. Error Handling:

  • Tool output이 "Error:"로 시작하면: (1) 네임스페이스 변경 후 동일 호출을 1회 재시도 (2) 재시도 실패 시: 해당 작업은 skip하고 다음 작업으로 진행

  • JSON/참조 검증 실패 시:

    • 수정/재생성 재시도 최대 2회(총 3회)
    • 이후에도 실패하면: 최선의 형태로 파일을 저장하고, 채팅 로그에 "VALIDATION WARNING: ..."만 남긴다.
  • NEVER proceed with empty or missing input. NEVER pass empty strings to subsequent steps.