# get_last_context

A read tool on the CogniRepo MCP server.

Agent View of the PolicyLayer registry record for `get_last_context`. HTML page: https://policylayer.com/tools/ashlesh-t-cognirepo/get-last-context

## Facts

- Tool: `get_last_context`
- Server: CogniRepo (`pypi:cognirepo`) — https://policylayer.com/tools/ashlesh-t-cognirepo.md
- Install: `npx -y pypi:cognirepo`
- Homepage: https://github.com/ashlesh-t/cognirepo
- Risk category: Read (Low risk)
- Registry record: grade A, identity unverified
- Server rate-limited: no
- Parameters: 0
- Recommended policy verdict: Allowed

## Example call (MCP tools/call, JSON-RPC 2.0)

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_last_context",
    "arguments": {}
  }
}
```

## Why get_last_context is rated Low

The tool appears to retrieve previously stored context or session information without modifying, deleting, or executing external operations. While the empty description prevents absolute certainty, the 'get_' prefix and consistency with sibling read operations on a memory management server indicate this is a data retrieval tool with minimal blast radius if misused.

From the tool's own definition: "Tool name 'get_last_context' with prefix 'get_' indicates a retrieval operation. Sibling tools like 'context_pack', 'episodic_search', 'get_session_brief', and 'get_agent_bootstrap' are all read-only retrieval tools on a persistent memory server."

## Use case

AI agents call get_last_context to retrieve information from CogniRepo without modifying anything. It is typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.

## Recommended policy (PolicyLayer)

Verdict: **Allowed**. Enforced by the PolicyLayer MCP gateway (https://policylayer.com/mcp-gateway) before a call reaches CogniRepo:

```json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "get_last_context": {}
  }
}
```

## Other tools on CogniRepo (33)

- `supersede_learning` — Other — https://policylayer.com/tools/ashlesh-t-cognirepo/supersede-learning.md
- `architecture_overview` — Read — https://policylayer.com/tools/ashlesh-t-cognirepo/architecture-overview.md
- `context_pack` — Read — https://policylayer.com/tools/ashlesh-t-cognirepo/context-pack.md
- `cross_repo_search` — Read — https://policylayer.com/tools/ashlesh-t-cognirepo/cross-repo-search.md
- `cross_repo_traverse` — Read — https://policylayer.com/tools/ashlesh-t-cognirepo/cross-repo-traverse.md
- `dependency_graph` — Read — https://policylayer.com/tools/ashlesh-t-cognirepo/dependency-graph.md
- `episodic_search` — Read — https://policylayer.com/tools/ashlesh-t-cognirepo/episodic-search.md
- `explain_change` — Read — https://policylayer.com/tools/ashlesh-t-cognirepo/explain-change.md
- `find_symbol_path` — Read — https://policylayer.com/tools/ashlesh-t-cognirepo/find-symbol-path.md
- `get_agent_bootstrap` — Read — https://policylayer.com/tools/ashlesh-t-cognirepo/get-agent-bootstrap.md
- `get_error_patterns` — Read — https://policylayer.com/tools/ashlesh-t-cognirepo/get-error-patterns.md
- `get_service_endpoints` — Read — https://policylayer.com/tools/ashlesh-t-cognirepo/get-service-endpoints.md
- `get_session_brief` — Read — https://policylayer.com/tools/ashlesh-t-cognirepo/get-session-brief.md
- `get_session_history` — Read — https://policylayer.com/tools/ashlesh-t-cognirepo/get-session-history.md
- `get_user_profile` — Read — https://policylayer.com/tools/ashlesh-t-cognirepo/get-user-profile.md
- `graph_stats` — Read — https://policylayer.com/tools/ashlesh-t-cognirepo/graph-stats.md
- `list_org_context` — Read — https://policylayer.com/tools/ashlesh-t-cognirepo/list-org-context.md
- `lookup_symbol` — Read — https://policylayer.com/tools/ashlesh-t-cognirepo/lookup-symbol.md
- `org_dependencies` — Read — https://policylayer.com/tools/ashlesh-t-cognirepo/org-dependencies.md
- `org_search` — Read — https://policylayer.com/tools/ashlesh-t-cognirepo/org-search.md
- `org_wide_search` — Read — https://policylayer.com/tools/ashlesh-t-cognirepo/org-wide-search.md
- `retrieve_memory` — Read — https://policylayer.com/tools/ashlesh-t-cognirepo/retrieve-memory.md
- `search_docs` — Read — https://policylayer.com/tools/ashlesh-t-cognirepo/search-docs.md
- `search_token` — Read — https://policylayer.com/tools/ashlesh-t-cognirepo/search-token.md
- `semantic_search_code` — Read — https://policylayer.com/tools/ashlesh-t-cognirepo/semantic-search-code.md
- `subgraph` — Read — https://policylayer.com/tools/ashlesh-t-cognirepo/subgraph.md
- `who_calls` — Read — https://policylayer.com/tools/ashlesh-t-cognirepo/who-calls.md
- `link_repos` — Write — https://policylayer.com/tools/ashlesh-t-cognirepo/link-repos.md
- `log_episode` — Write — https://policylayer.com/tools/ashlesh-t-cognirepo/log-episode.md
- `record_decision` — Write — https://policylayer.com/tools/ashlesh-t-cognirepo/record-decision.md
- …and 3 more: https://policylayer.com/tools/ashlesh-t-cognirepo.md

## For agents

This record is a snapshot. Live verdicts and the full registry:

- Check every server in your MCP config at once: `npx -y policylayer stack`
- Vet a server before you add it: install the mcp-precheck skill — `npx skills add https://policylayer.com` (skill text: https://policylayer.com/skill.md)
- Query the registry over MCP: endpoint `https://api.policylayer.com/mcp` — tools `check_mcp_server`, `check_mcp_stack`, `check_tool`, `search_registry`, `get_change_events`

---

Source: the PolicyLayer MCP registry — one continuously verified record per MCP server. Full record: https://policylayer.com/registry?q=ashlesh-t-cognirepo · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/ashlesh-t-cognirepo
