Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
daf2d54
Add data visualization for Anthropic
Vasilije1990 Jan 10, 2025
b132ff4
Update cognee-mcp/cognee_mcp/server.py
Vasilije1990 Jan 11, 2025
7b0bfe9
Update cognee-mcp/cognee_mcp/server.py
Vasilije1990 Jan 11, 2025
cf4737b
Update cognee-mcp/cognee_mcp/server.py
Vasilije1990 Jan 12, 2025
55e9d64
Add data visualization for Anthropic
Vasilije1990 Jan 13, 2025
047948a
Add data visualization for Anthropic
Vasilije1990 Jan 14, 2025
3ba98b2
Merge branch 'dev' into COG-975
Vasilije1990 Jan 14, 2025
ad07bae
Add data visualization for Anthropic
Vasilije1990 Jan 14, 2025
a0e3686
Update README.md
Vasilije1990 Jan 14, 2025
61118dd
Update README.md
Vasilije1990 Jan 14, 2025
e71f852
Update README.md
Vasilije1990 Jan 14, 2025
933d21a
Update dockerhub pushes
Vasilije1990 Jan 14, 2025
aef7822
Merge branch 'dev' into COG-975
Vasilije1990 Jan 15, 2025
be0b486
Update lock files
Vasilije1990 Jan 16, 2025
662faeb
Update format
Vasilije1990 Jan 16, 2025
4a87df9
Update format
Vasilije1990 Jan 16, 2025
4ae8eb9
Update format
Vasilije1990 Jan 16, 2025
1af24dc
Update format
Vasilije1990 Jan 16, 2025
b2355de
Update format
Vasilije1990 Jan 16, 2025
5b31638
Update format
Vasilije1990 Jan 16, 2025
f19b58a
Update format
Vasilije1990 Jan 16, 2025
5aaf420
Fix for now
Vasilije1990 Jan 16, 2025
72b503f
Fix for now
Vasilije1990 Jan 16, 2025
7a4a0f4
Fix for now
Vasilije1990 Jan 16, 2025
0783625
Fix for now
Vasilije1990 Jan 16, 2025
bbd51e8
Fix for now
Vasilije1990 Jan 16, 2025
cb7b2d3
Fix for now
Vasilije1990 Jan 16, 2025
fe47253
Fix for now
Vasilije1990 Jan 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update cognee-mcp/cognee_mcp/server.py
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
Vasilije1990 and coderabbitai[bot] authored Jan 11, 2025
commit b132ff499073d27dac7898c3dcab46db447529bb
13 changes: 11 additions & 2 deletions cognee-mcp/cognee_mcp/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,21 +103,30 @@ async def handle_list_tools() -> list[types.Tool]:


def get_freshest_png(directory: str) -> Image.Image:
if not os.path.exists(directory):
raise FileNotFoundError(f"Directory {directory} does not exist")

# List all files in 'directory' that end with .png
files = [f for f in os.listdir(directory) if f.endswith(".png")]
if not files:
raise FileNotFoundError("No PNG files found in the given directory.")

# Sort by integer value of the filename (minus the '.png')
# Example filename: 1673185134.png -> integer 1673185134
files_sorted = sorted(files, key=lambda x: int(x.replace(".png", "")))
try:
files_sorted = sorted(files, key=lambda x: int(x.replace(".png", "")))
except ValueError as e:
raise ValueError("Invalid PNG filename format. Expected timestamp format.") from e

# The "freshest" file has the largest timestamp
freshest_filename = files_sorted[-1]
freshest_path = os.path.join(directory, freshest_filename)

# Open the image with PIL and return the PIL Image object
return Image.open(freshest_path)
try:
return Image.open(freshest_path)
except (IOError, OSError) as e:
raise IOError(f"Failed to open PNG file {freshest_path}") from e

@server.call_tool()
async def handle_call_tool(
Expand Down
Loading