MCPcopy Create free account

hub / github.com/anthropics/claude-cookbooks / functions

Functions640 in github.com/anthropics/claude-cookbooks

↓ 126 callersMethodget
Get from cache - RACE CONDITION on hit/miss counts.
tool_use/memory_demo/sample_code/data_processor_v1.py:111
↓ 38 callersMethodexecute
Mock execute - just returns the query for inspection.
tool_use/memory_demo/sample_code/sql_query_builder.py:10
↓ 9 callersMethodsearch
(self, query, k=5, similarity_threshold=0.3)
capabilities/text_to_sql/evaluation/vectordb.py:40
↓ 7 callersFunctionextract_sql
(text)
capabilities/text_to_sql/evaluation/tests/utils.py:6
↓ 7 callersMethodsearch
(self, query, k=3, similarity_threshold=0.75)
capabilities/retrieval_augmented_generation/evaluation/vectordb.py:43
↓ 7 callersMethodset
Set in cache - RACE CONDITION on dict modification.
tool_use/memory_demo/sample_code/data_processor_v1.py:120
↓ 6 callersFunction_get_ticket
Helper to retrieve a ticket by ID
tool_use/utils/customer_service_tools.py:35
↓ 6 callersMethod_validate_path
Validate and resolve memory paths to prevent directory traversal attacks. Args: path: The path to validate (must start w
tool_use/memory_tool.py:37
↓ 6 callersFunctionexecute_sql
(sql)
capabilities/text_to_sql/evaluation/tests/utils.py:11
↓ 5 callersFunctionrequire_env
(name: str)
managed_agents/sentry/cma.py:21
↓ 5 callersMethodsafe_divide
Safely divide two numbers, returning default if denominator is zero.
skills/custom_skills/analyzing-financial-statements/calculate_ratios.py:27
↓ 5 callersFunctionslugify
(s: str)
managed_agents/example_data/orchestrate/src/url_utils.py:4
↓ 4 callersFunctionformat_json
Format data as JSON string, truncating if too long.
tool_use/utils/visualize.py:116
↓ 4 callersMethodgenerate_dashboard
Generate dashboard view of validation results.
scripts/validate_all_notebooks.py:239
↓ 4 callersFunctionget_project_root
Get the project root directory.
tests/conftest.py:61
↓ 3 callersFunctionadd
(a, b)
managed_agents/example_data/iterate/calc.py:1
↓ 3 callersFunctioncommandOf
(call: ToolCall)
managed_agents/roadtrip_planner/src/components/tool-rail.tsx:19
↓ 3 callersFunctiondelete_agent_pod
Delete the agent pod for a session. Searches by label first (works for both claimed standby and on-demand pods), then falls back to the conve
claude_agent_sdk/hosting/kubernetes/gateway/k8s.py:530
↓ 3 callersMethodexecute
Execute a memory tool command. Args: **params: Command parameters from Claude's tool use Returns: D
tool_use/memory_tool.py:76
↓ 3 callersFunctionfetch
(req)
managed_agents/slack/src/main.ts:22
↓ 3 callersFunctionfind_all_notebooks
Find all notebooks in a directory. Args: root_dir: Root directory to search exclude_patterns: List of glob patterns to exclu
tests/notebook_tests/utils.py:371
↓ 3 callersFunctiongetAccessToken
(orgId: string)
managed_agents/linear/src/oauth.ts:62
↓ 3 callersFunctionget_confluence_auth_header
Generate Basic auth header for Confluence API.
claude_agent_sdk/site_reliability_agent/sre_mcp_server.py:1863
↓ 3 callersFunctionget_schema_info
()
capabilities/text_to_sql/evaluation/prompts.py:6
↓ 3 callersMethodisLive
()
managed_agents/self_hosted_sandboxes/cf/src/container.ts:38
↓ 3 callersFunctionnormalize_path
(path: str)
managed_agents/example_data/orchestrate/src/url_utils.py:10
↓ 3 callersFunctionparse_response
Parse a Claude API response into a structured format.
tool_use/utils/visualize.py:67
↓ 3 callersMethodproject_cash_flows
Project future cash flows based on assumptions. Returns: Dictionary with projected financials
skills/custom_skills/creating-financial-models/dcf_model.py:156
↓ 3 callersMethodreview_code
Review code with memory-enhanced analysis. Args: code: The code to review filename: Name of the file being r
tool_use/memory_demo/code_review_demo.py:98
↓ 3 callersMethodsave_state
Save current state to file.
scripts/validate_all_notebooks.py:47
↓ 3 callersMethodstart
(opts: StartOpts)
managed_agents/self_hosted_sandboxes/cf-worker/src/runner.ts:44
↓ 3 callersMethodvalidate_notebook
Validate a single notebook.
scripts/validate_all_notebooks.py:67
↓ 3 callersFunctionvalidate_notebook_structure
Run all structural validations on a notebook. This validates the notebook without executing it.
tests/notebook_tests/utils.py:253
↓ 3 callersFunctionvisualize_message
Visualize a Claude API message in the terminal.
tool_use/utils/visualize.py:284
↓ 2 callersFunction_build_pod_manifest
Build a V1Pod manifest for an agent pod. A V1Pod is the Python representation of a Kubernetes Pod spec. It has two main sections: - me
claude_agent_sdk/hosting/kubernetes/gateway/k8s.py:69
↓ 2 callersFunction_first_text
Return the first text block's content (skips thinking/tool blocks).
evals/agentic_search/utils/agentic_search.py:108
↓ 2 callersFunction_get_standby_pods
Return names of standby pods that are Ready to serve a session. Uses a K8s label selector to filter — this is efficient because the API serve
claude_agent_sdk/hosting/kubernetes/gateway/k8s.py:316
↓ 2 callersFunction_is_message_list
Check if content is a list of SDK message objects. Uses duck-typing to check for message-like objects rather than relying on fragile cla
claude_agent_sdk/utils/html_renderer.py:141
↓ 2 callersFunction_owned_pod_ip
Return the session's pod IP if it exists and belongs to ``tenant``. ``None`` means the session doesn't exist yet — the caller may create it a
claude_agent_sdk/hosting/kubernetes/gateway/main.py:172
↓ 2 callersFunction_pod_is_ready
True when the pod is Running, has an IP, and all containers are Ready. "Running" only means the container process started; the readiness probe
claude_agent_sdk/hosting/kubernetes/gateway/k8s.py:265
↓ 2 callersFunction_render_code_block
Render content as a code block. Args: content: String to display in code block Returns: HTML pre/code block string
claude_agent_sdk/utils/html_renderer.py:279
↓ 2 callersFunction_render_markdown_text
Render text as markdown HTML if the markdown library is available. Enables extensions for tables, fenced code blocks, and other common markd
claude_agent_sdk/utils/html_renderer.py:257
↓ 2 callersFunction_render_message_list
Extract and render the final assistant text from a message list. Searches backwards through messages to find the last AssistantMessage w
claude_agent_sdk/utils/html_renderer.py:225
↓ 2 callersFunction_replenish_pool
Top up the standby pool to STANDBY_POOL_SIZE. Called after a pod is claimed or deleted. Creates pods one at a time and re-counts the pool be
claude_agent_sdk/hosting/kubernetes/gateway/k8s.py:412
↓ 2 callersFunction_schedule_replenish
Kick off pool replenishment as a background asyncio task. This is fire-and-forget — the caller doesn't wait for replenishment to finish. If
claude_agent_sdk/hosting/kubernetes/gateway/k8s.py:454
↓ 2 callersFunction_validate_session_id
(session_id: str)
claude_agent_sdk/hosting/kubernetes/gateway/main.py:80
↓ 2 callersFunction_wait_for_pod_running
Poll a pod until it is Running *and* Ready. Returns the pod IP. K8s pod phases: Pending -> Running -> Succeeded/Failed. We need to wait beca
claude_agent_sdk/hosting/kubernetes/gateway/k8s.py:279
↓ 2 callersMethodauto_fix_issues
Auto-fix safe issues like deprecated models.
scripts/validate_all_notebooks.py:613
↓ 2 callersFunctionbaseURL
()
managed_agents/self_hosted_sandboxes/vercel/api/webhook.ts:69
↓ 2 callersFunctionbuild_system_prompt
(org: str, project: str)
managed_agents/sentry/agent_config.py:15
↓ 2 callersMethodcalculate_enterprise_value
Calculate enterprise value by discounting cash flows. Args: terminal_method: Method for terminal value calculation
skills/custom_skills/creating-financial-models/dcf_model.py:267
↓ 2 callersFunctiondisplay
Fallback display for non-Jupyter environments.
claude_agent_sdk/utils/html_renderer.py:34
↓ 2 callersFunctiondisplay_agent_response
Display the final assistant response from a conversation in a styled card. Extracts the last text response from an agent's message history a
claude_agent_sdk/utils/html_renderer.py:362
↓ 2 callersFunctiondivide
(a, b)
managed_agents/example_data/iterate/calc.py:5
↓ 2 callersFunctiondotClass
(call: ToolCall)
managed_agents/roadtrip_planner/src/components/tool-rail.tsx:25
↓ 2 callersFunctionexchange
(params: Record<string, string>)
managed_agents/linear/src/oauth.ts:76
↓ 2 callersMethodexport_github_issue
Export results as GitHub issue markdown.
scripts/validate_all_notebooks.py:342
↓ 2 callersFunctionextract_model_from_messages
Extract the model identifier from a list of messages. Looks for model information in SystemMessage or ResultMessage. Args: mess
claude_agent_sdk/utils/agent_visualizer.py:77
↓ 2 callersFunctionextract_result_tag
Return the contents of the last <result>...</result> in `text`, or None.
evals/agentic_search/utils/agentic_search.py:102
↓ 2 callersFunctionfetch
(req)
managed_agents/linear/src/main.ts:34
↓ 2 callersMethodgenerate_batch
Generate a batch of tickets
tool_use/utils/customer_service_api.py:216
↓ 2 callersFunctionget_container_logs
Get logs from a Docker container.
claude_agent_sdk/site_reliability_agent/sre_mcp_server.py:2425
↓ 2 callersFunctioninline
(text: string, key: string)
managed_agents/roadtrip_planner/src/components/markdown.tsx:25
↓ 2 callersMethodinterpret_ratio
Interpret a single ratio with context. Args: ratio_name: Name of the ratio value: Calculated ratio value
skills/custom_skills/analyzing-financial-statements/interpret_ratios.py:70
↓ 2 callersMethodisLive
()
managed_agents/self_hosted_sandboxes/cf-worker/src/runner.ts:40
↓ 2 callersFunctionkvStore
()
managed_agents/self_hosted_sandboxes/vercel/api/webhook.ts:101
↓ 2 callersFunctionloadEnvLocal
()
managed_agents/roadtrip_planner/setup/env.ts:11
↓ 2 callersMethodload_data
(self, data)
capabilities/retrieval_augmented_generation/evaluation/vectordb.py:20
↓ 2 callersMethodload_db
(self)
capabilities/text_to_sql/evaluation/vectordb.py:15
↓ 2 callersMethodload_db
(self)
capabilities/classification/evaluation/vectordb.py:73
↓ 2 callersFunctionload_notebook
Load a notebook from disk.
tests/notebook_tests/utils.py:50
↓ 2 callersFunctionload_registry
Load the notebook registry.
tests/conftest.py:66
↓ 2 callersFunctionparse_notebook_cells
Parse cells from a notebook structure.
tests/notebook_tests/utils.py:56
↓ 2 callersFunctionregisterTools
(server: McpServer)
managed_agents/cma-mcp/src/tools.ts:10
↓ 2 callersFunctionreset_activity_context
Reset the subagent tracking context. Call before starting a new query to ensure clean state for subagent tracking. Example:: #
claude_agent_sdk/utils/agent_visualizer.py:207
↓ 2 callersMethodrun_validation
Run validation on all notebooks.
scripts/validate_all_notebooks.py:463
↓ 2 callersFunctionsandboxKey
(sessionId: string)
managed_agents/self_hosted_sandboxes/vercel/api/webhook.ts:112
↓ 2 callersFunctionsave
(m: Map<string, TokenEntry>)
managed_agents/linear/src/oauth.ts:19
↓ 2 callersMethodsave_db
(self)
capabilities/text_to_sql/evaluation/vectordb.py:54
↓ 2 callersMethodsave_db
(self)
capabilities/retrieval_augmented_generation/evaluation/vectordb.py:70
↓ 2 callersMethodsave_db
(self)
capabilities/retrieval_augmented_generation/evaluation/vectordb.py:155
↓ 2 callersFunctionscore_candidate
Score a candidate based on weighted criteria
claude_agent_sdk/chief_of_staff_agent/scripts/talent_scorer.py:11
↓ 2 callersMethodsearch
(self, query, k=5, similarity_threshold=0.85)
capabilities/classification/evaluation/vectordb.py:45
↓ 2 callersFunctionsend_error
Send a JSON-RPC error response.
claude_agent_sdk/site_reliability_agent/sre_mcp_server.py:2651
↓ 2 callersFunctionsend_response
Send a JSON-RPC response to stdout.
claude_agent_sdk/site_reliability_agent/sre_mcp_server.py:2644
↓ 2 callersMethodstop
()
managed_agents/self_hosted_sandboxes/cf-worker/src/runner.ts:63
↓ 2 callersFunctionvalidate_all_cells_executed
Validate that all code cells have been executed. Returns a list of issues found.
tests/notebook_tests/utils.py:115
↓ 2 callersFunctionvalidate_cell_execution_order
Validate that code cells were executed in order. Returns a list of issues found.
tests/notebook_tests/utils.py:79
↓ 2 callersFunctionvalidate_no_error_outputs
Validate that no cells have error outputs. Returns a list of issues found.
tests/notebook_tests/utils.py:130
↓ 2 callersFunctionvalidate_no_hardcoded_secrets
Validate that no cells contain hardcoded API keys or secrets. Returns a list of issues found.
tests/notebook_tests/utils.py:171
↓ 1 callersFunction_appendix_tables_b_c
Generate appendix Tables B1-B5 and C1-C4. Deterministic (seeded hash, no imports), so repeat kernel runs are identical and COMPACTION_PROBES
tool_use/context_engineering/research_corpus.py:597
↓ 1 callersFunction_assess_overall_health
Assess overall financial health based on ratio analysis.
skills/custom_skills/analyzing-financial-statements/interpret_ratios.py:314
↓ 1 callersFunction_build_options
Build the same agent config as notebook 00, plus hosting concerns.
claude_agent_sdk/hosting/server.py:135
↓ 1 callersFunction_claim_standby_pod
Try to atomically claim a standby pod for a session. Returns pod IP or None. Atomically claim by patching labels. If two gateways race to claim
claude_agent_sdk/hosting/kubernetes/gateway/k8s.py:371
↓ 1 callersFunction_client
Shared client for both webhook verification and the work poller. Async because ``client.beta.environments.work.poller(...)`` is async-only (i
managed_agents/self_hosted_sandboxes/daytona/daytona_webhook.py:40
↓ 1 callersFunction_client
Shared client for both webhook verification and the work poller. Lazy because ``modal deploy`` imports this module locally, where the secret
managed_agents/self_hosted_sandboxes/modal/modal_sandbox_webhook.py:71
↓ 1 callersFunction_count_standby_pods
Count standby pods that exist or are on their way (Pending or Running). Used when deciding whether to create more. Unlike ``_get_standby_pods``
claude_agent_sdk/hosting/kubernetes/gateway/k8s.py:336
↓ 1 callersMethod_create
Create or overwrite a file.
tool_use/memory_tool.py:174
↓ 1 callersFunction_create_sandbox
( session_id: str, *, environment_id: str, work_id: str, environment_key: str, sandbox
managed_agents/self_hosted_sandboxes/modal/modal_sandbox_webhook.py:114
↓ 1 callersFunction_create_standby_pod
Create a single standby pod and return its name. Standby pods are pre-warmed: they pull the image, start the container, and sit idle waiting
claude_agent_sdk/hosting/kubernetes/gateway/k8s.py:238
next →1–100 of 640, ranked by callers