MCPcopy Create free account
hub / github.com/adcontextprotocol/adcp / getById

Method getById

server/src/db/agent-context-db.ts:204–238  ·  view source on GitHub ↗

* Get a specific agent context by ID

(id: string)

Source from the content-addressed store, hash-verified

202 * Get a specific agent context by ID
203 */
204 async getById(id: string): Promise<AgentContext | null> {
205 const result = await query(
206 `SELECT
207 id,
208 organization_id,
209 agent_url,
210 agent_name,
211 agent_type,
212 protocol,
213 auth_token_encrypted IS NOT NULL as has_auth_token,
214 auth_token_hint,
215 auth_type,
216 oauth_access_token_encrypted IS NOT NULL as has_oauth_token,
217 oauth_refresh_token_encrypted IS NOT NULL as has_oauth_refresh_token,
218 oauth_token_expires_at,
219 oauth_client_id IS NOT NULL as has_oauth_client,
220 (oauth_cc_token_endpoint IS NOT NULL
221 AND oauth_cc_client_id IS NOT NULL
222 AND oauth_cc_client_secret_encrypted IS NOT NULL) as has_oauth_client_credentials,
223 tools_discovered,
224 last_discovered_at,
225 last_test_scenario,
226 last_test_passed,
227 last_test_summary,
228 last_tested_at,
229 total_tests_run,
230 created_at,
231 updated_at,
232 created_by
233 FROM agent_contexts
234 WHERE id = $1`,
235 [id]
236 );
237 return result.rows[0] || null;
238 }
239
240 /**
241 * Get agent context by organization and URL

Callers 7

createAgentOAuthRouterFunction · 0.95
updateMethod · 0.95
saveAuthTokenMethod · 0.95
saveOAuthTokensMethod · 0.95
saveOAuthClientMethod · 0.95
createMemberToolHandlersFunction · 0.80

Calls 1

queryFunction · 0.85

Tested by

no test coverage detected