MCPcopy
hub / github.com/mindverse/Second-Me / list_documents

Function list_documents

lpm_kernel/api/domains/documents/routes.py:22–41  ·  view source on GitHub ↗

List all documents Query Parameters: include_l0 (bool): Whether to include L0 data (chunks and embeddings)

()

Source from the content-addressed store, hash-verified

20
21@document_bp.route("/documents/list", methods=["GET"])
22def list_documents():
23 """
24 List all documents
25 Query Parameters:
26 include_l0 (bool): Whether to include L0 data (chunks and embeddings)
27 """
28 try:
29 # get query params
30 include_l0 = request.args.get("include_l0", "").lower() == "true"
31 if include_l0:
32 documents = document_service.list_documents_with_l0()
33 return jsonify(APIResponse.success(data=documents))
34 else:
35 documents = document_service.list_documents()
36 return jsonify(
37 APIResponse.success(data=[doc.to_dict() for doc in documents])
38 )
39 except Exception as e:
40 logger.error(f"Error listing documents: {str(e)}", exc_info=True)
41 return jsonify(APIResponse.error(message=f"Error listing documents: {str(e)}"))
42
43
44@document_bp.route("/documents/scan", methods=["POST"])

Callers

nothing calls this directly

Calls 6

successMethod · 0.80
errorMethod · 0.80
getMethod · 0.45
list_documentsMethod · 0.45
to_dictMethod · 0.45

Tested by

no test coverage detected