test_hardcoded_filter
Verify Frappe API filtering functionality by testing a hardcoded filter that bypasses parameter validation issues.
Instructions
Test hardcoded filter to verify Frappe API filtering works. This bypasses all parameter validation issues.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| doctype | Yes |
Implementation Reference
- src/tools/documents.py:922-950 (handler)The handler function implementing the test_hardcoded_filter tool. It performs a hardcoded count query on Bank Transaction documents with status 'Unreconciled' using the Frappe API, bypassing filter parsing issues.async def test_hardcoded_filter(doctype: str) -> str: """ Test hardcoded filter to verify Frappe API filtering works. This bypasses all parameter validation issues. """ try: client = get_client() # Hard-code filters for testing if doctype == "Bank Transaction": # Test unreconciled filter test_filters = {"status": "Unreconciled"} params = { "fields": json.dumps(["count(name) as count"]), "filters": json.dumps(test_filters) } response = await client.get(f"api/resource/{doctype}", params=params) if "data" in response and response["data"]: count = response["data"][0].get("count", 0) return f"HARDCODED TEST: Found {count} {doctype} with status='Unreconciled'" else: return f"HARDCODED TEST: No data returned for {doctype}" else: return f"HARDCODED TEST: Only supports 'Bank Transaction' doctype for now" except Exception as error: return f"HARDCODED TEST ERROR: {error}"