MCPcopy Create free account
hub / github.com/RASAAS/docmcp-knowledge / get_all_docs

Method get_all_docs

scripts/migrate_wordpress.py:120–140  ·  view source on GitHub ↗

Fetch all published docs with pagination.

(self)

Source from the content-addressed store, hash-verified

118 return None
119
120 def get_all_docs(self) -> List[dict]:
121 """Fetch all published docs with pagination."""
122 all_docs = []
123 page = 1
124 params: dict = {
125 "per_page": 100,
126 "status": "publish",
127 "_fields": "id,title,slug,link,content,parent,modified",
128 }
129 while True:
130 params["page"] = page
131 docs = self.api_get("docs", params)
132 if not docs or not isinstance(docs, list):
133 break
134 all_docs.extend(docs)
135 print(f" Fetched page {page}: {len(docs)} docs (total: {len(all_docs)})")
136 if len(docs) < 100:
137 break
138 page += 1
139 time.sleep(self.delay)
140 return all_docs
141
142 def detect_output_path(self, link: str) -> Tuple[str, str]:
143 """

Callers 2

list_structureMethod · 0.95
migrateMethod · 0.95

Calls 1

api_getMethod · 0.95

Tested by

no test coverage detected