Skip to main content
Glama

lc_changed

Identify files modified since a specific timestamp in a directory to track changes and updates.

Instructions

Returns list of files modified since given timestamp. Args: root_path: Root directory path (e.g. '/home/user/projects/myproject') timestamp: Unix timestamp to check modifications since

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
root_pathYes
timestampYes

Implementation Reference

  • Handler function for the 'lc_changed' MCP tool. It creates an ExecutionEnvironment for the given root_path and delegates to commands.list_modified_files to compute the list of changed files.
    @mcp.tool() def lc_changed(root_path: str, timestamp: float) -> str: """Returns list of files modified since given timestamp. Args: root_path: Root directory path (e.g. '/home/user/projects/myproject') timestamp: Unix timestamp to check modifications since """ env = ExecutionEnvironment.create(Path(root_path)) with env.activate(): return commands.list_modified_files(env, timestamp)
  • Helper function implementing the core logic of listing added, modified, and removed files by comparing the current file selection (based on the rule at the timestamp) against the selection stored at that timestamp.
    def list_modified_files(env: ExecutionEnvironment, timestamp: float) -> str: matching_selection = env.state.selections.get_selection_by_timestamp(timestamp) if matching_selection is None: raise ValueError( f"No context found with timestamp {timestamp}. The context may be stale or deleted." ) config = ContextSpec.create( env.config.project_root_path, matching_selection.rule_name, env.constants ) selector = ContextSelector.create(config) file_sel_full = selector.select_full_files(matching_selection) file_sel_excerpted = selector.select_excerpted_files(file_sel_full) current_files = set(file_sel_excerpted.files) original_files = set(matching_selection.files) converter = PathConverter.create(env.config.project_root_path) modified = { f for f in (current_files & original_files) if is_newer(converter.to_absolute([f])[0], timestamp) } added = current_files - original_files removed = original_files - current_files result = [ f"{label}:\n" + "\n".join(sorted(files)) for label, files in [("Added", added), ("Modified", modified), ("Removed", removed)] if files ] return "\n\n".join(result) if result else "No changes"

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/cyberchitta/llm-context.py'

If you have feedback or need assistance with the MCP directory API, please join our Discord server